Skip to content

Commit

Permalink
Use system in matrix as opposed to runner
Browse files Browse the repository at this point in the history
This allows best matrix visualisation indicating which job is for which
system.
  • Loading branch information
nbdd0121 committed May 28, 2024
1 parent bf4dbb2 commit c753ad3
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,6 @@ jobs:
fi
for SYSTEM in "${SYSTEMS[@]}"; do
# Choose a GitHub runner for the given system.
case $SYSTEM in
x86_64-linux)
RUNNER=nixos-23.11
;;
x86_64-darwin)
RUNNER=macos-13
;;
aarch64-darwin)
RUNNER=macos-14
;;
esac
# This is a json object with package names as keys and their main outputs as values
PACKAGES=$(nix eval --json ".#packages.$SYSTEM")
Expand All @@ -98,7 +85,7 @@ jobs:
if [[ $CACHED == y ]]; then
echo "| $ATTR | $SYSTEM | ✅ Cached |" | tee -a $GITHUB_STEP_SUMMARY
else
REBUILD+=("$(jq --null-input '{attr: $attr, runner: $runner}' --arg attr "$ATTR" --arg runner "$RUNNER")")
REBUILD+=("$(jq --null-input '{attr: $attr, system: $system}' --arg attr "$ATTR" --arg system "$SYSTEM")")
echo "| $ATTR | $SYSTEM | ⏳ Need Rebuild |" | tee -a $GITHUB_STEP_SUMMARY
fi
done
Expand All @@ -118,7 +105,7 @@ jobs:
include: ${{fromJSON(needs.build-plan.outputs.matrix)}}
# Disable fail-fast for non-PR builds to ensure all outputs have a chance to be built.
fail-fast: ${{ github.event_name == 'pull_request' }}
runs-on: ${{ matrix.runner }}
runs-on: ${{ matrix.system == 'x86_64-darwin' && 'macos-13' || (matrix.system == 'aarch64-darwin' && 'macos-14' || 'nixos-23.11') }}
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit c753ad3

Please sign in to comment.