Compare commits

..

1 Commits

Author SHA1 Message Date
045ff818bd
CI: get real inputs, and do a full run
Some checks failed
test / Setup (push) Successful in 2m19s
test / Test and Lint (push) Failing after 15s
test / Full run (push) Failing after 14s
2024-12-13 23:41:45 -08:00
2 changed files with 49 additions and 43 deletions

View File

@ -2,58 +2,64 @@ name: test
on: on:
push: push:
branches: [ main ] branches: [main]
env: 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
- name: setup toolchain - name: setup toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1 uses: actions-rust-lang/setup-rust-toolchain@v1
with: with:
cache: true cache: true
components: clippy, rustfmt components: clippy, rustfmt
toolchain: stable toolchain: stable
- name: install cargo-aoc - name: install cargo-aoc
run: cargo install --locked cargo-aoc run: cargo install --locked cargo-aoc
- name: get date - name: get date
id: date id: date
run: | run: |
echo date=$(date +%Y%m%d) > $GITHUB_OUTPUT echo date=$(date +%Y%m%d) > $GITHUB_OUTPUT
- name: Get cached inputs - name: Get cached inputs
id: inputs id: inputs
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: input path: input
key: ${{ steps.date.outputs.date }} key: ${{ steps.date.outputs.date }}
- name: Get inputs from source - name: Get inputs from source
if: steps.inputs.outputs.cache-hit != 'true' if: steps.inputs.outputs.cache-hit != 'true'
run: | run: |
cargo aoc credentials ${{ secrets.AOC_SESSION }} cargo aoc credentials ${{ secrets.AOC_SESSION }}
for i in $(seq 1 25); do for i in $(seq 1 25); do
dayfmt=$(printf %02d $i) dayfmt=$(printf %02d $i)
if [${{ steps.date.outputs.date }} -ge 202412${dayfmt}]; then if [ ${{ steps.date.outputs.date }} -ge 202412${dayfmt} ]; then
cargo aoc input --year 2024 --day $i cargo aoc input --year 2024 --day $i
fi fi
done done
test:
runs-on: ubuntu-latest
name: Test and Lint
steps:
- name: cargo test
run: cargo test --lib --all-features
- name: cargo test - name: rustfmt
run: cargo test --lib --all-features run: cargo fmt --all -- --check
- name: rustfmt - name: clippy
run: cargo fmt --all -- --check run: cargo clippy --lib --all-features --tests -- -D warnings
run:
- name: clippy runs-on: ubuntu-latest
run: cargo clippy --lib --all-features --tests -- -D warnings name: Full run
steps:
- name: full run - name: full run
run: cargo run --release run: cargo run --release

View File

@ -89,7 +89,7 @@ pub fn part2(input: &str) -> IntType {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
pub const EXAMPLE: &str = "125 17"; pub const EXAMPLE: &str = &"125 17";
#[test] #[test]
fn part1_example() { fn part1_example() {