Prebuild DevX closures #230
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Prebuild DevX closures | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
wait-for-hydra-eval: | |
env: | |
HYDRA_JOB: ci/eval | |
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 | |
upload: | |
needs: wait-for-hydra-eval | |
name: Container Upload | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- x86_64-darwin | |
- x86_64-linux | |
- aarch64-darwin | |
# Currently broken | |
#- aarch64-linux | |
compiler-nix-name: | |
- ghc8107 | |
- ghc928 | |
- ghc962 | |
target-platform: | |
- "" | |
- "-static" | |
- "-js" | |
- "-windows" | |
variant: | |
- "" | |
- "-minimal" | |
iog: | |
- "" | |
- "-iog" | |
exclude: | |
# Just cross compiling javascript with ghc 9.6.2 for now | |
- compiler-nix-name: ghc8107 | |
target-platform: "-js" | |
- compiler-nix-name: ghc928 | |
target-platform: "-js" | |
# Static builds not working for darwin yet | |
- platform: x86_64-darwin | |
target-platform: "-static" | |
# Static tools not working right now (so just building "-static-minimal" for now) | |
- target-platform: "-static" | |
variant: "" | |
# Windows cross compilation only works on x86_64-linux right now. | |
- platform: aarch64-darwin | |
target-platform: "-windows" | |
- platform: aarch64-linux | |
target-platform: "-windows" | |
- platform: x86_64-darwin | |
target-platform: "-windows" | |
# It does not makes sense to build minimal image that include IOG extra tooling ... | |
# ... "-minimal" and "-iog" are mutually exclusive options! | |
- variant: "-minimal" | |
iog: "-iog" | |
# On darwin the `-js` target require `-minimal` to be set: | |
- target-platform: "-js" | |
platform: aarch64-darwin | |
variant: "" | |
- target-platform: "-js" | |
platform: x86_64-darwin | |
variant: "" | |
uses: ./.github/workflows/wait-and-upload.yml | |
with: | |
platform: ${{ matrix.platform }} | |
target-platform: ${{ matrix.target-platform }} | |
compiler-nix-name: ${{ matrix.compiler-nix-name }} | |
minimal: ${{ matrix.variant == '-minimal' }} | |
iog: ${{ matrix.iog == '-iog' }} |