-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (69 loc) · 2.35 KB
/
ci.yml
File metadata and controls
84 lines (69 loc) · 2.35 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
name: CI
on:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: "20 4 * * *"
jobs:
build:
name: Build and Test (${{ matrix.mode }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode: [debug, release]
steps:
- uses: actions/checkout@v4
# Install Rust with caching
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# Cache Cargo dependencies and build artifacts for faster builds
- name: Cache Cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry/index
key: cargo-registry-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-registry-${{ runner.os }}-
- name: Cache Cargo dependencies
uses: actions/cache@v4
with:
path: ~/.cargo/registry/cache
key: cargo-deps-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-deps-${{ runner.os }}-
- name: Cache Cargo git dependencies
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: cargo-git-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-git-${{ runner.os }}-
- name: Cache build artifacts
uses: actions/cache@v4
with:
path: target
key: cargo-target-${{ matrix.mode }}-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-target-${{ matrix.mode }}-${{ runner.os }}-
- name: Cache cargo tools
uses: actions/cache@v4
with:
path: ~/.cargo/bin
key: cargo-tools-${{ runner.os }}-binstall-outdated
restore-keys: |
cargo-tools-${{ runner.os }}-
# Check for outdated dependencies - FAILS build if updates are available
# (Makefile handles cargo-binstall and cargo-outdated installation)
# Only run dependency check once (in debug mode)
- name: Check dependencies (${{ matrix.mode }})
run: make check-deps MODE=${{ matrix.mode }}
- name: Lint (${{ matrix.mode }})
run: make lint MODE=${{ matrix.mode }}
- name: Build (${{ matrix.mode }})
run: make build MODE=${{ matrix.mode }}
- name: Run unit tests (${{ matrix.mode }})
run: cargo test --all-features ${{ matrix.mode == 'release' && '--release' || '' }}
- name: Build docs
run: make docs