mirror of
https://github.com/input-output-hk/devx.git
synced 2024-09-19 08:07:19 +03:00
Try wait-for-hydra action (#105)
* Update main.yml * Update main.yml * Update main.yml
This commit is contained in:
parent
cf203c4609
commit
523d0f296d
29
.github/workflows/main.yml
vendored
29
.github/workflows/main.yml
vendored
@ -18,30 +18,9 @@ jobs:
|
||||
name: "Wait for hydra status"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get specific check run status
|
||||
run: |
|
||||
# start with a random sleep to prevent hitting the api too hard.
|
||||
while true; do
|
||||
# For GitHub Apps
|
||||
# conclusion=$(gh api repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/status --jq '.check_runs[] | select(.name == "ci/hydra-build:$DEV_SHELL") | .conclusion')
|
||||
# For GitHub Statuses; we need --paginate because there are so many statuses
|
||||
echo "Querying: gh api repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/status --paginate --jq '.statuses[] | select(.context == \"$HYDRA_JOB\") | .state'"
|
||||
conclusion=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/status" --paginate --jq ".statuses[] | select(.context == \"$HYDRA_JOB\") | .state")
|
||||
case "$conclusion" in
|
||||
success)
|
||||
echo "$HYDRA_JOB succeeded"
|
||||
exit 0;;
|
||||
failure)
|
||||
echo "$HYDRA_JOB failed"
|
||||
exit 1;;
|
||||
*)
|
||||
echo "conclusion is: '$conclusion'"
|
||||
gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/status" --paginate --jq '.statuses[] | .state+"\t"+.context'|sort
|
||||
WAIT=$((30 + RANDOM % 30))
|
||||
echo "$HYDRA_JOB pending. Waiting ${WAIT}s..."
|
||||
sleep $WAIT;;
|
||||
esac
|
||||
done
|
||||
- uses: input-output-hk/actions/wait-for-hydra@latest
|
||||
with:
|
||||
status: ci/hydra-build:required
|
||||
|
||||
upload:
|
||||
needs: wait-for-hydra-eval
|
||||
@ -106,4 +85,4 @@ jobs:
|
||||
target-platform: ${{ matrix.target-platform }}
|
||||
compiler-nix-name: ${{ matrix.compiler-nix-name }}
|
||||
minimal: ${{ matrix.variant == '-minimal' }}
|
||||
iog: ${{ matrix.iog == '-iog' }}
|
||||
iog: ${{ matrix.iog == '-iog' }}
|
||||
|
Loading…
Reference in New Issue
Block a user