Repository navigation
127 lines (102 loc) · 3.67 KB
/
Copy pathrust.yml
File metadata and controls
127 lines (102 loc) · 3.67 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Rust
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
msrv:
name: Verify MSRV (1.99.1)
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain (1.99.1)
uses: dtolnay/rust-toolchain@1.99.1
- name: Check
run: cargo check --all-features
build_linux:
needs: msrv
name: Build Linux
strategy:
fail-fast: false # force all builds to run even if one fails
matrix:
include:
- target: x86_64-unknown-linux-gnu
rust: stable
run-tests: true
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
if: matrix.run-tests
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Check Code Format
if: matrix.run-tests
run: cargo fmt --all -- --check
- name: Code Lint
if: matrix.run-tests
run: cargo +${{ matrix.rust }} clippy --all-targets --all-features --target ${{ matrix.target }} -- -D warnings
- name: Build
run: cargo +${{ matrix.rust }} build --verbose --all-features --target ${{ matrix.target }}
- name: Run tests
if: matrix.run-tests
# The test list enables every feature except the three slow gates,
# so the test jobs stay inside their budgets (docs/ci-test-budget.md).
# Keep the list in sync with the [features] table. Code Lint above
# keeps --all-features, so the gated code stays lint-checked.
run: |
cargo +${{ matrix.rust }} test --verbose --features deprecated,legacy_chacha20_fallback,wasm --target ${{ matrix.target }}
build_macos:
needs: msrv
name: Build macOS
strategy:
fail-fast: false # force all builds to run even if one fails
matrix:
include:
- target: aarch64-apple-darwin
rust: stable
run-tests: true
- target: x86_64-apple-darwin
rust: stable
run-tests: true
runs-on: [self-hosted, macos, arm64]
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
components: rustfmt, clippy
- name: Check Code Format
if: matrix.run-tests
run: cargo fmt --all -- --check
- name: Code Lint
if: matrix.run-tests
run: cargo +${{ matrix.rust }} clippy --all-targets --all-features --target ${{ matrix.target }} -- -D warnings
- name: Build
run: cargo +${{ matrix.rust }} build --verbose --all-features --target ${{ matrix.target }}
- name: Run tests
if: matrix.run-tests
# The test list enables every feature except the three slow gates,
# so the test jobs stay inside their budgets (docs/ci-test-budget.md).
# Keep the list in sync with the [features] table. Code Lint above
# keeps --all-features, so the gated code stays lint-checked.
run: |
cargo +${{ matrix.rust }} test --verbose --features deprecated,legacy_chacha20_fallback,wasm --target ${{ matrix.target }}
audit:
needs: [build_linux, build_macos]
name: Security Audit
runs-on: [self-hosted, linux, x64]
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-audit
run: command -v cargo-audit >/dev/null 2>&1 || cargo install cargo-audit
- name: Run cargo audit
run: cargo audit