Skip to content

Commit

Permalink
Try wait-for-hydra action (#105)
Browse files Browse the repository at this point in the history
* Update main.yml

* Update main.yml

* Update main.yml
  • Loading branch information
angerman authored Oct 18, 2023
1 parent cf203c4 commit 523d0f2
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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' }}

0 comments on commit 523d0f2

Please sign in to comment.