Skip to content

Commit

Permalink
Run both parts of a day in the same matrix job
Browse files Browse the repository at this point in the history
Also check if they are available.
  • Loading branch information
lpenz committed Dec 17, 2023
1 parent f871b2c commit b7bcdc9
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- day14
- day15
- day16
part: [ a, b ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [ omnilint, rust ]
Expand All @@ -42,12 +41,12 @@ jobs:
- name: build ${{ matrix.day }}${{ matrix.part }}
run: |
cargo build \
--release \
-p ${{ matrix.day }} \
--bin ${{ matrix.day }}${{ matrix.part }}
- name: solve ${{ matrix.day }}${{ matrix.part }}
run: |
./target/release/${{ matrix.day }}${{ matrix.part }} \
< ${{ matrix.day }}/input.txt \
2>&1 | tee "$GITHUB_STEP_SUMMARY"
--release \
-p ${{ matrix.day }}
for part in a b; do
bin="./target/release/${{ matrix.day }}$part"
if [ -x "$bin" ]; then
(set -x; "$bin" < ${{ matrix.day }}/input.txt) 2>&1 | tee -a "$GITHUB_STEP_SUMMARY"
fi
done

0 comments on commit b7bcdc9

Please sign in to comment.