-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Evgeni Gordeev
committed
Nov 30, 2024
1 parent
0e1dca9
commit 20f689b
Showing
13 changed files
with
1,447 additions
and
190 deletions.
There are no files selected for viewing
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
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## 2024 | ||
|
||
 | ||
 | ||
 | ||
[](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) | [](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) | | ||
| ----------------------------------------- | --------------------------------- | ------------------------- | --- | | ||
| [all](https://adventofcode.com/2024) | AoC 24 | [txt](2024/answers.txt) | [](https://github.com/EvgeniGordeev/adventofcode/actions/workflows/ci2024.yaml) | | ||
|
||
* or ** - external solution adopted | ||
|
||
## External |
Oops, something went wrong.