-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (89 loc) · 2.61 KB
/
Copy pathrust-build-test-run.yaml
File metadata and controls
108 lines (89 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Rust build, test and run
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
build-test-run:
strategy:
fail-fast: false
matrix:
profile:
- dev
- release
- test
runner:
- ubuntu-24.04
- macos-15
include:
- clippy: false
- run: true
- test: false
- profile: dev
clippy: true
- profile: test
run: false
test: true
name: ${{ matrix.runner }} - ${{ matrix.profile }} - Build + test + run
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
defaults:
run:
working-directory: solvers/rust
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup tools through mise
uses: ./.github/actions/mise-project-setup
with:
directory: solvers/rust
- name: Setup rust cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: ${{ matrix.profile }}
workspaces: solvers/rust
- name: Fetch dependencies
run: cargo fetch --verbose --locked
- name: Build
env:
PROFILE: ${{ matrix.profile }}
run: cargo build --verbose --frozen --all-targets --profile "${PROFILE}"
shell: bash
- if: matrix.test
name: Test
env:
PROFILE: ${{ matrix.profile }}
run: cargo test --verbose --frozen --all-targets --profile "${PROFILE}"
shell: bash
- name: Check
env:
PROFILE: ${{ matrix.profile }}
run: cargo check --verbose --frozen --all-targets --profile "${PROFILE}"
shell: bash
- if: matrix.clippy
name: Clippy
env:
PROFILE: ${{ matrix.profile }}
run: cargo clippy --verbose --frozen --all-targets --profile "${PROFILE}" -- -D warnings
shell: bash
- if: matrix.run
name: Restore aoc-main project
uses: ./.github/actions/uv-project-setup
with:
directory: aoc-main
- if: matrix.run
name: Extract inputs
uses: ./.github/actions/extract-inputs
with:
encryption-key: ${{ secrets.INPUTS_ENCRYPTION_KEY }}
- if: matrix.run
name: Run all solutions
env:
AOC_RUST_BUILD_ARGS: --verbose --frozen --profile ${{ matrix.profile }}
run: mise run aoc:all -- --solver rust
shell: bash
working-directory: .