Compare commits
1 Commits
b060de20c7
...
045ff818bd
Author | SHA1 | Date | |
---|---|---|---|
045ff818bd |
46
.github/workflows/test.yaml
vendored
46
.github/workflows/test.yaml
vendored
@ -8,8 +8,8 @@ env:
|
|||||||
CARGO_TERM_COLOR: always
|
CARGO_TERM_COLOR: always
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
setup:
|
||||||
name: AoC 2024
|
name: Setup
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -20,16 +20,46 @@ jobs:
|
|||||||
components: clippy, rustfmt
|
components: clippy, rustfmt
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: fake inputs
|
- name: install cargo-aoc
|
||||||
run: |
|
run: cargo install --locked cargo-aoc
|
||||||
mkdir -p input/2024/
|
|
||||||
for i in $(seq 1 25); do touch input/2024/day${i}.txt; done
|
|
||||||
|
|
||||||
|
- name: get date
|
||||||
|
id: date
|
||||||
|
run: |
|
||||||
|
echo date=$(date +%Y%m%d) > $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Get cached inputs
|
||||||
|
id: inputs
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: input
|
||||||
|
key: ${{ steps.date.outputs.date }}
|
||||||
|
|
||||||
|
- name: Get inputs from source
|
||||||
|
if: steps.inputs.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
cargo aoc credentials ${{ secrets.AOC_SESSION }}
|
||||||
|
for i in $(seq 1 25); do
|
||||||
|
dayfmt=$(printf %02d $i)
|
||||||
|
if [ ${{ steps.date.outputs.date }} -ge 202412${dayfmt} ]; then
|
||||||
|
cargo aoc input --year 2024 --day $i
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Test and Lint
|
||||||
|
steps:
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
run: cargo test --lib --all-features
|
run: cargo test --lib --all-features
|
||||||
|
|
||||||
- name: rustfmt
|
- name: rustfmt
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
# - name: clippy
|
- name: clippy
|
||||||
# run: cargo clippy --lib --all-features --tests -- -D warnings
|
run: cargo clippy --lib --all-features --tests -- -D warnings
|
||||||
|
run:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Full run
|
||||||
|
steps:
|
||||||
|
- name: full run
|
||||||
|
run: cargo run --release
|
||||||
|
Loading…
x
Reference in New Issue
Block a user