Skip to content

Commit

Permalink
prepare for aoc 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeni Gordeev committed Nov 30, 2024
1 parent 0e1dca9 commit 20f689b
Show file tree
Hide file tree
Showing 13 changed files with 1,447 additions and 190 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci2024.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 }}
27 changes: 27 additions & 0 deletions 2024.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## 2024

![](https://img.shields.io/badge/stars%20⭐-0-yellow)
![](https://img.shields.io/badge/days%20completed-0-red)
![](https://img.shields.io/badge/day%20📅-0-blue)
[![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-all-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml)

* [https://adventofcode.com/2024](https://adventofcode.com/2024)

To profile with hyperfine - `brew install hyperfine`

* `hyperfine --warmup 3 -r 10 '2024/01.py'`
* ```find 2024 -type f -regex ".*/[0-9]*\.py" -exec hyperfine --warmup 3 -r 10 'python {}' \;```
* ```python -m cProfile 2024/01.py```
* ```time python 2024/01.py```
* ```hyperfine --warmup 3 -r 10 'find 2024 -type f -regex ".*/[0-9]*\.py" | sort -n | xargs -L 1 python ' | tee 2024/benchmark-m1.txt```
* ```bin/run-all-solutions.py --dir 2024 --write```

| Day | Name | Solution | CI Benchmark |
|-------------------------------------------|-----------------------------------|---------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [01](https://adventofcode.com/2024/day/1) | Trebuchet | [py](2024/01.py) | [![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-01-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) |
| ----------------------------------------- | --------------------------------- | ------------------------- | --- |
| [all](https://adventofcode.com/2024) | AoC 24 | [txt](2024/answers.txt) | [![badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/EvgeniGordeev/13c6cac3c39702cdcb9cc169b66c3210/raw/runtime-badge-2024-all-ci.json)](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) |

* or ** - external solution adopted

## External
Loading

0 comments on commit 20f689b

Please sign in to comment.