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 1e9a1ba
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,22 @@ jobs:
- day14
- day15
- day16
part: [ a, b ]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [ omnilint, rust ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
- name: build ${{ matrix.day }}${{ matrix.part }}
- name: build ${{ matrix.day }}
run: |
cargo build \
--release \
-p ${{ matrix.day }} \
--bin ${{ matrix.day }}${{ matrix.part }}
- name: solve ${{ matrix.day }}${{ matrix.part }}
--release \
-p ${{ matrix.day }}
- name: solve ${{ matrix.day }}
run: |
./target/release/${{ matrix.day }}${{ matrix.part }} \
< ${{ matrix.day }}/input.txt \
2>&1 | tee "$GITHUB_STEP_SUMMARY"
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 1e9a1ba

Please sign in to comment.