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
name: ci build
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
jobs:
fmt-clippy-test:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
steps:
- uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
- name: Format check
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Clippy (all features)
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Build
run: cargo build --workspace --verbose
- name: Test
run: cargo test --workspace --verbose
dependencies:
name: Dependency Submission
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo artifacts
uses: Swatinem/rust-cache@v2
- name: Install cargo-sbom
uses: psastras/sbom-rs/actions/install-cargo-sbom@cargo-sbom-v0.10.0
- name: Generate SBOM
run: cargo-sbom --output-format=spdx_json_2_3 > sbom.json
- name: Upload SBOM as artifact
uses: actions/upload-artifact@v4
with:
name: sbom
path: sbom.json
- name: Submit dependencies to GitHub
uses: advanced-security/spdx-dependency-submission-action@v0.2.0
with:
filePath: sbom.json