From ba0455ce36093baba553a22e7f2f40c2ea81f985 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Fri, 13 Dec 2024 23:24:24 -0800 Subject: [PATCH] CI: get real inputs, and do a full run --- .github/workflows/test.yaml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7dac880..bdb73d1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,10 +20,25 @@ jobs: components: clippy, rustfmt toolchain: stable - - name: fake inputs + - name: install cargo-aoc + run: cargo install --locked cargo-aoc + + - 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: | - mkdir -p input/2024/ - for i in $(seq 1 25); do touch input/2024/day${i}.txt; done + cargo aoc credentials ${{ secrets.AOC_SESSION }} + for i in $(seq 1 25); do cargo aoc input --year 2024 --day $i; done - name: cargo test run: cargo test --lib --all-features @@ -31,5 +46,8 @@ jobs: - name: rustfmt run: cargo fmt --all -- --check - # - name: clippy - # run: cargo clippy --lib --all-features --tests -- -D warnings + - name: clippy + run: cargo clippy --lib --all-features --tests -- -D warnings + + - name: full run + run: cargo run --release