Skip to content

2024 day 3

2024 day 3 #6

Workflow file for this run

name: AoC-2024
env:
YEAR: 2024
on:
push:
branches:
- main
paths:
- "2024/**"
- "$YEAR/**" # variables inside paths don't work
workflow_dispatch:
jobs:
_run-all-solutions_:
runs-on: ubuntu-latest
container:
image: egordeev/adventofcode:python-3.13-hyperfine
steps:
- uses: actions/checkout@v3
- name: Run all and verify output
run: |
cp $YEAR/answers.txt answers.tmp.txt
bin/run-all-solutions.py --dir $YEAR --write
cmp -s $YEAR/answers.txt answers.tmp.txt || exit 1
- name: Benchmarking
run: |
hyperfine --warmup 3 -r 10 "find $YEAR -type f -regex '.*/[0-9]*\.py' | sort -n | xargs -I {} python {}" | tee $YEAR/benchmark-ci.txt
echo "=== All Benchmarks ==="
find $YEAR -type f -regex ".*/[0-9]*\.py" | sort -n | xargs -I {} bash -c "hyperfine --warmup 3 -r 10 {} | tee {}.benchmark-ci.txt"
- name: Create Awesome Badges
run: |
bin/create-awesome-badges.py --dir $YEAR --gist 13c6cac3c39702cdcb9cc169b66c3210 --secret ${{ secrets.GIST_GITHUB_SECRET }}