-
Notifications
You must be signed in to change notification settings - Fork 31
94 lines (88 loc) · 2.79 KB
/
ci-build.yml
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
name: ci-build
on:
push:
branches: [ main, release/** ]
pull_request:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Docs
run: cargo doc --all-features
env:
RUSTDOCFLAGS: -Dwarnings
build-binaries:
strategy:
matrix:
rust-toolchain: [
# MSRV from Cargo.toml
"1.71",
"stable",
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-toolchain }}
components: clippy
- name: Build
run: cargo build --verbose --package prio-binaries
- name: Clippy
run: cargo clippy --package prio-binaries
build-crate:
strategy:
matrix:
rust-toolchain: [
# MSRV from Cargo.toml
"1.71",
"stable",
]
runs-on: ubuntu-latest
env:
CARGO_ALL_FEATURES_VERSION: 1.9.0
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-toolchain }}
components: clippy, rustfmt
- name: Cache cargo-all-features
uses: actions/cache@v4
with:
key: cargo-all-features-bins-${{ env.CARGO_ALL_FEATURES_VERSION }}-rust-${{ matrix.rust-toolchain }}
path: |
${{ runner.tool_cache }}/cargo-build-all-features
${{ runner.tool_cache }}/cargo-check-all-features
${{ runner.tool_cache }}/cargo-test-all-features
- name: Add the tool cache directory to the search path
run: echo "${{ runner.tool_cache }}/cargo-all-features/bin/" >> $GITHUB_PATH
- name: Ensure that the tool cache is populated with the cargo-all-features binaries
run: cargo install --root ${{ runner.tool_cache }}/cargo-all-features --version ${{ env.CARGO_ALL_FEATURES_VERSION }} cargo-all-features
- name: Lint
run: |
cargo fmt --message-format human -- --check
bash -c '! git grep "[I][P][D][F]"'
- name: Check
run: cargo check-all-features --workspace --all-targets
- name: Clippy
run: cargo clippy --workspace --all-targets
- name: Clippy (all features)
run: cargo clippy --workspace --all-targets --all-features
- name: Build crate
run: cargo build-all-features --verbose --package prio
- name: Run tests
run: cargo test-all-features --verbose
- name: Build benchmarks
run: cargo bench --no-run --profile=dev
- name: Build benchmarks (all features)
run: cargo bench --no-run --profile=dev --all-features