Repository navigation
345 lines (288 loc) · 12.8 KB
/
Copy pathcode-checks.yml
File metadata and controls
345 lines (288 loc) · 12.8 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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# SPDX-FileCopyrightText: 2026 ReallyMe Technologies Limited
#
# SPDX-License-Identifier: MIT OR Apache-2.0
name: Code Checks
on:
workflow_call:
outputs:
verified_sha:
value: ${{ jobs.verified.outputs.verified_sha }}
permissions:
contents: read
jobs:
repository-policy:
name: repository policy and tooling (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# Portable tooling shares the Intel pool with sanitizers. Swift retains
# ARM execution without making these jobs compete for ARM capacity.
os: [ubuntu-24.04, macos-15-intel]
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
fetch-depth: 0
- name: Checkout release-readiness runner
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: reallyme/release-readiness
ref: 16aab5287de498e858ff3b85d9e66d7c9f7ebb74
path: .release-readiness
persist-credentials: false
- name: Install Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '26'
- name: Verify release readiness pins before testing
if: matrix.os != 'ubuntu-24.04'
run: node scripts/run_pinned_release_readiness.mjs --check-pins
- name: Reject tracked ignored files
run: node scripts/check_ignored_files.mjs --history
# Corroborate the verified checkout against the immutable upstream
# source once. Other lanes use their local digest checks.
- name: Verify pinned readiness core against upstream
if: matrix.os == 'ubuntu-24.04'
run: node scripts/run_pinned_release_readiness.mjs --check-pins --verify-upstream
- name: Install ShellCheck
if: matrix.os == 'ubuntu-24.04'
uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2.90.8
with:
tool: shellcheck@0.11.0
- name: Install actionlint
if: matrix.os == 'ubuntu-24.04'
run: bash scripts/install_actionlint.sh
- name: Lint workflows
if: matrix.os == 'ubuntu-24.04'
run: actionlint
# Globs include new regression suites without a second hand-maintained list.
- name: Test repository scripts and browser tooling
run: node --test --test-concurrency=4 "scripts/**/*.test.mjs" "packages/ts/scripts/*.test.mjs"
- name: Test Gradle policy tools
run: python3 -m unittest discover -s scripts -p '*_test.py'
rust:
name: fmt, lint, test, wasm, package
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: 1.100.0
components: rustfmt, clippy
targets: wasm32-unknown-unknown
- name: Cache Cargo
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Separate this cache from entries containing unmanaged Cargo tools.
key: rust-dependencies
cache-bin: false
- name: Install nextest
uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2.90.8, nextest
with:
tool: cargo-nextest@0.9.152
- name: Install cargo-deny
run: cargo +1.100.0 install cargo-deny --version '=0.22.0' --locked
- name: Install cargo-audit
uses: taiki-e/install-action@fe3acb53a98b62c772db35de75ce0e4595e7ca8c # v2.90.8, cargo-audit
with:
tool: cargo-audit@0.23.0
- name: Install Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '26'
cache: npm
cache-dependency-path: packages/ts/package-lock.json
- name: Format
run: cargo fmt --check
- name: Check warnings as errors
run: RUSTFLAGS=-Dwarnings cargo check --workspace --all-features --locked
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
- name: Test
run: cargo nextest run --workspace --all-features --locked
- name: Test on the release toolchain
run: cargo +1.100.0 test --locked --workspace --all-features
- name: Check codec feature subsets
run: |
cargo test -p reallyme-codec --no-default-features --all-targets --locked
for feature in base64 base64url cbor der hex jcs multibase multicodec multikey pem operation-contract serde; do
cargo test -p reallyme-codec --no-default-features --features "$feature" --all-targets --locked
done
- name: Test JCS under serde_json feature unification
run: cargo test --manifest-path probes/jcs-feature-unification/Cargo.toml --locked
- name: Test DER under BER feature unification
run: cargo test --manifest-path probes/der-feature-unification/Cargo.toml --locked
- name: Doc build
run: cargo doc --workspace --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
- name: Doctests
run: cargo test --workspace --all-features --doc --locked
- name: Check codec WASM crate
run: |
cargo check -p reallyme-codec-wasm --target wasm32-unknown-unknown --locked
cargo check -p reallyme-codec --no-default-features --features der --target wasm32-unknown-unknown --locked
- name: Install TypeScript codec package dependencies
run: npm ci --prefix packages/ts
- name: Audit production npm dependencies
run: npm audit --prefix packages/ts --omit=dev --audit-level=high
- name: Dependency policy
run: cargo +1.100.0 deny --locked --workspace --all-features --config deny.toml check advisories licenses sources
- name: Security advisory audit
run: scripts/audit_committed_lockfiles.sh
rust-msrv:
name: Test publishable crates on Rust 1.100.0
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install minimum supported Rust
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: 1.100.0
- name: Cache Cargo
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: Test reallyme-codec at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec --all-features
- name: Test reallyme-codec-base64 at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-base64 --all-features
- name: Test reallyme-codec-base64url at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-base64url --all-features
- name: Test reallyme-codec-cbor at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-cbor --all-features
- name: Test reallyme-codec-hex at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-hex --all-features
- name: Test reallyme-codec-jcs at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-jcs --all-features
- name: Test reallyme-codec-multibase at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-multibase --all-features
- name: Test reallyme-codec-multicodec at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-multicodec --all-features
- name: Test reallyme-codec-multikey at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-multikey --all-features
- name: Test reallyme-codec-pem at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-pem --all-features
- name: Test reallyme-codec-proto at MSRV
run: cargo +1.100.0 test --locked --package reallyme-codec-proto --all-features
native-sanitizers:
name: native sanitizer lanes
# Keep this portable lane off the capacity-constrained ARM pool. The Swift
# lane still exercises ARM macOS; sanitizer tests also cover Intel macOS.
runs-on: macos-15-intel
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust sanitizer toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: nightly-2026-11-10
- name: Test native sanitizer lanes
run: scripts/test_native_sanitizers.sh
ffi-abi-artifact:
name: FFI release artifact and C sanitizer
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: 1.100.0
- name: Verify release artifact through C sanitizer harness
run: scripts/test_ffi_abi_release_artifact.sh
ffi-miri:
name: FFI Miri tests
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install pinned Miri toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: nightly-2026-11-10
components: miri
- name: Run FFI Miri tests
# Cap-sized allocation tests run under nextest; Miri targets the unsafe
# pointer and unwind boundaries where its interpreter adds coverage.
run: |
cargo +nightly-2026-11-10 miri test -p reallyme-codec-ffi --lib pointer::tests --locked
cargo +nightly-2026-11-10 miri test -p reallyme-codec-ffi --lib guard::tests --locked
cargo +nightly-2026-11-10 miri test -p reallyme-codec --no-default-features --features der --test der_canonical_tests --locked
cargo +nightly-2026-11-10 miri test -p reallyme-codec-cbor --test general_tests semantic_equivalent_keys_are_rejected_without_sorting --locked
cargo +nightly-2026-11-10 miri test -p reallyme-codec-cbor --test general_zeroization_tests --locked
kotlin:
name: kotlin codec package on Linux
runs-on: ubuntu-24.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Verify Gradle dependency provenance
run: python3 scripts/verify_gradle_checksum_provenance.py
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Install Java
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
with:
problem-matcher: true
distribution: temurin
java-version: '21'
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: 1.100.0
- name: Install Node for JNI resource staging
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '26'
- name: Build and stage Linux JNI library
run: |
scripts/build_kotlin_native_resource.sh build/sdk-native-resources
node scripts/write_native_manifest.mjs build/sdk-native-resources build/sdk-native-resources/me/really/codec/native/native-manifest.json
- name: Test Kotlin codec package
working-directory: packages/kotlin
run: ./gradlew test "-Preallyme.codec.nativeResourcesDir=${{ github.workspace }}/build/sdk-native-resources"
env:
REALLYME_CODEC_FFI_LIBRARY_PATH: ${{ github.workspace }}/target/release/libreallyme_codec_ffi.so
verified:
name: Record verified code checks
runs-on: ubuntu-24.04
timeout-minutes: 5
needs:
- repository-policy
- rust
- rust-msrv
- native-sanitizers
- ffi-abi-artifact
- ffi-miri
- kotlin
outputs:
verified_sha: ${{ steps.verified.outputs.sha }}
steps:
- name: Record verified source
id: verified
env:
SOURCE_SHA: ${{ github.sha }}
run: printf 'sha=%s\n' "$SOURCE_SHA" >>"$GITHUB_OUTPUT"