Skip to content

Commit

Permalink
Add user input execution to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lpenz committed Dec 16, 2023
1 parent 0c6a4e0 commit e4a3ee2
Show file tree
Hide file tree
Showing 18 changed files with 1,222 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,35 @@ jobs:
coveralls: true
publish_cratesio: false
publish_github_release: false
solve:
strategy:
matrix:
day:
- day01
- day02
- day03
- day04
- day05
- day06
- day07
- day08
- day09
- day10
- day11
- day12
- day13
- day14
- day15
- day16
part: [ a, b ]
# if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: solve ${{ matrix.day }}${{ matrix.part }}
run: |
cargo run \
--release \
-p ${{ matrix.day }} \
--bin ${{ matrix.day }}${{ matrix.part }} \
< ${{ matrix.day }}/input.txt
6 changes: 6 additions & 0 deletions day-new
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

day="${1?day not specified}"

if [ -d "$day" ]; then
echo "$day" already exists
exit 1
fi

set -e -x

cp -R day00-template "$day"
mv "$day/src/bin/day00a.rs" "$day/src/bin/${day}a.rs"
find "$day" -type f -exec sed -i "s@day00@${day}@g" {} +
sed -i "s@^\\]@ \"${day}\",\\n]@" Cargo.toml
sed -i "s@^\( \+part: .*\)\$@ - ${day}\\n\1@" .github/workflows/ci.yml
cargo test -p "$day"
Loading

0 comments on commit e4a3ee2

Please sign in to comment.