-
-
Notifications
You must be signed in to change notification settings - Fork 0
178 lines (150 loc) · 7.29 KB
/
Copy pathci.yml
File metadata and controls
178 lines (150 loc) · 7.29 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: Rust CI
on:
push:
branches:
- main
- temp-dev-2.0.0
pull_request:
branches:
- main
- temp-dev-2.0.0
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
checks:
name: Format, lint, test, and package
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Install Rust toolchain
shell: bash
run: scripts/ci_install_rust.sh
- name: Cache Rust build output
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-on-failure: true
- name: Audit dependencies
shell: bash
run: |
if ! cargo audit --version >/dev/null 2>&1; then
cargo install cargo-audit --version 0.22.2 --locked
fi
if [ "$(cargo deny --version 2>/dev/null || true)" != "cargo-deny 0.20.2" ]; then
cargo install cargo-deny --version 0.20.2 --locked --force
fi
cargo audit --deny warnings
- name: Run checks
run: scripts/checks.sh
platform:
name: Platform tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Rust toolchain
shell: bash
run: scripts/ci_install_rust.sh
- name: Cache Rust build output
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-on-failure: true
- name: Test default features
run: cargo test --all-targets
- name: Test all features
if: runner.os == 'Linux'
run: cargo test --all-targets --all-features
- name: Test portable native features
if: runner.os != 'Linux'
run: cargo test --all-targets --features "alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native"
- name: Check no_std library build
run: cargo check --no-default-features --lib
target-build:
name: no_std target build (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- wasm32-unknown-unknown
- thumbv7em-none-eabihf
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Rust toolchain
shell: bash
run: scripts/ci_install_rust.sh
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Cache Rust build output
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-on-failure: true
- name: Check no_std library build
run: cargo check --no-default-features --lib --target ${{ matrix.target }}
mapped-backend-build:
name: mapped backend build (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
features: all
- target: aarch64-unknown-linux-gnu
features: memory-lock,guard-pages,multi-pass-clear
- target: x86_64-apple-darwin
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: aarch64-apple-darwin
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: aarch64-apple-ios
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: x86_64-apple-ios
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: x86_64-pc-windows-gnu
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: aarch64-linux-android
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: x86_64-linux-android
features: alloc,std,derive,serde,subtle-interop,zeroize-interop,memory-lock,wasm-compat,canary-check,random-canary,asm-compare,strict-compare,cache-flush,register-scrub,guard-pages,page-seal,strict-canary-check,multi-pass-clear,hardware-secrets,split-secret,profile-hardened-native,profile-guarded-native
- target: x86_64-unknown-freebsd
features: memory-lock,guard-pages,multi-pass-clear
steps:
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Install Rust toolchain
shell: bash
run: scripts/ci_install_rust.sh
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Cache Rust build output
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
cache-on-failure: true
- name: Check mapped backend library build
shell: bash
run: |
if [ "${{ matrix.features }}" = "all" ]; then
cargo check --lib --all-features --target ${{ matrix.target }}
else
cargo check --lib --features "${{ matrix.features }}" --target ${{ matrix.target }}
fi