Compare commits
2 Commits
045ff818bd
...
b060de20c7
Author | SHA1 | Date | |
---|---|---|---|
b060de20c7 | |||
bc7ec50c94 |
34
.github/workflows/test.yaml
vendored
34
.github/workflows/test.yaml
vendored
@ -20,10 +20,31 @@ jobs:
|
|||||||
components: clippy, rustfmt
|
components: clippy, rustfmt
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: fake inputs
|
- name: install cargo-aoc
|
||||||
|
run: cargo install --locked cargo-aoc
|
||||||
|
|
||||||
|
- name: get date
|
||||||
|
id: date
|
||||||
run: |
|
run: |
|
||||||
mkdir -p input/2024/
|
echo date=$(date +%Y%m%d) > $GITHUB_OUTPUT
|
||||||
for i in $(seq 1 25); do touch input/2024/day${i}.txt; done
|
|
||||||
|
- 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
|
||||||
|
|
||||||
- name: cargo test
|
- name: cargo test
|
||||||
run: cargo test --lib --all-features
|
run: cargo test --lib --all-features
|
||||||
@ -31,5 +52,8 @@ jobs:
|
|||||||
- 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
|
||||||
|
|
||||||
|
- name: full run
|
||||||
|
run: cargo run --release
|
||||||
|
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user