2023 day 14: rewrite for better performance #154
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: Run answer tests | |
on: [push, pull_request] | |
jobs: | |
setup-matrix: | |
uses: ./.github/workflows/generate-matrix.yml | |
with: | |
mode: answer | |
docker-build: | |
uses: ./.github/workflows/docker-build.yml | |
permissions: | |
packages: write | |
with: | |
ubuntu-version: 22.04 | |
llvm-version: 17 | |
matrix-job: | |
runs-on: ubuntu-latest | |
needs: [setup-matrix, docker-build] | |
if: ${{ needs.setup-matrix.outputs.targets != '[]' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
TARGET: ${{ fromJson(needs.setup-matrix.outputs.targets) }} | |
container: ${{ needs.docker-build.outputs.image }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Mark git checkout as safe | |
shell: bash | |
working-directory: ${{ matrix.TARGET.directory }} | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Run answer tests (clang++) | |
timeout-minutes: 2 | |
id: clang | |
uses: ./.github/actions/answer-test-action | |
with: | |
compiler: clang++ | |
- name: Run answer tests (g++) | |
timeout-minutes: 2 | |
id: gcc | |
# ignore failures in the previous step | |
if: success() || steps.clang.conclusion == 'failure' | |
uses: ./.github/actions/answer-test-action | |
with: | |
compiler: g++ | |
- name: Run answer tests (clang++-17, libc++) | |
timeout-minutes: 2 | |
# ignore failures in the previous two steps | |
if: success() || steps.clang.conclusion == 'failure' || steps.gcc.conclusion == 'failure' | |
uses: ./.github/actions/answer-test-action | |
with: | |
compiler: clang++-17 | |
stdlib: libc++ |