-
-
Notifications
You must be signed in to change notification settings - Fork 47
79 lines (69 loc) · 2.05 KB
/
rust.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
name: Rust CI
on:
pull_request:
push:
branches:
- "main"
jobs:
lint:
name: Linting & Coding Standards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup update
rustup component add clippy
- uses: Swatinem/rust-cache@v2
- name: Lint
run: |
cargo fmt -- --check
cargo clippy --all-targets --workspace --tests
dependencies:
name: Check Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install Rust Toolchain
run: |
rustup update
rustup install nightly
cargo install cargo-udeps
- name: Check for unused dependencies
run: |
cargo +nightly udeps
test:
name: Test Suite Runs - ${{ matrix.test-arm }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- # test with the current stable version
test-arm: "Stable"
rust-version: "stable"
continue-on-error: false
- # test with the MSRV version
test-arm: "Minimum Supported Rust Version"
rust-version: "1.71.1"
continue-on-error: false
- # test with the current nightly version (allowed to fail)
test-arm: "Nightly"
rust-version: "nightly"
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install Rust Toolchain
run: |
rustup update
rustup install ${{ matrix.rust-version }}
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo +${{ matrix.rust-version }} build --verbose
continue-on-error: ${{ matrix.continue-on-error }}
- name: Execute tests
run: cargo +${{ matrix.rust-version }} test --verbose
continue-on-error: ${{ matrix.continue-on-error }}
- name: Run CLI
run: cargo +${{ matrix.rust-version }} run -- cyclonedx