21
21
- name : Check formatting
22
22
run : cargo fmt --all -- --check
23
23
24
+ lints :
25
+ name : Check lints with clippy
26
+ runs-on : ubuntu-latest
27
+ steps :
28
+ - uses : actions/checkout@v4
29
+ - name : Check formatting
30
+ run : cargo clippy --all-targets -- -D clippy::all -D clippy::cargo
31
+
24
32
docs :
25
33
name : Check documentation
26
34
runs-on : ubuntu-latest
@@ -29,17 +37,105 @@ jobs:
29
37
- name : Check documentation
30
38
run : RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items --no-deps
31
39
32
- build :
33
- name : Execute CI script
40
+ check :
41
+ name : Check for errors
34
42
runs-on : ubuntu-latest
43
+ continue-on-error : true
44
+ strategy :
45
+ matrix :
46
+ target :
47
+ - x86_64-unknown-linux-gnu
48
+ - armv7-unknown-linux-gnueabi
49
+ - armv7-unknown-linux-gnueabihf
50
+ - arm-unknown-linux-gnueabi
51
+ - aarch64-unknown-linux-gnu
52
+ - i686-unknown-linux-gnu
53
+ - loongarch64-unknown-linux-gnu
54
+ - powerpc64-unknown-linux-gnu
55
+ - powerpc64le-unknown-linux-gnu
56
+ - x86_64-pc-windows-msvc
57
+ - x86_64-apple-darwin
58
+ - aarch64-apple-darwin
59
+ - x86_64-unknown-freebsd
60
+ - riscv64gc-unknown-linux-gnu
61
+ toolchain :
62
+ - stable
63
+ - " 1.77" # MSRV
35
64
steps :
36
65
- uses : actions/checkout@v4
37
66
- name : Setup Rust toolchain
38
67
uses : actions-rs/toolchain@v1
39
68
with :
40
- toolchain : stable
41
- - name : " Installs SoftHSM and execute tests"
42
- uses : ./.github/actions/ci_script
69
+ toolchain : ${{ matrix.toolchain }}
70
+ default : true
71
+ - name : Install Rust target
72
+ run : rustup target add ${{ matrix.target }}
73
+ - name : Check source
74
+ run : cargo check --target ${{ matrix.target }} --workspace --all-targets
75
+ - name : Check all features source
76
+ run : cargo check --target ${{ matrix.target }} --all-features --workspace --all-targets
77
+
78
+ check-matrix :
79
+ name : Check if all checks succeeded
80
+ if : always()
81
+ needs :
82
+ - check
83
+ runs-on : ubuntu-latest
84
+ steps :
85
+ - name : Decide whether the needed jobs succeeded or failed
86
+ uses : re-actors/alls-green@release/v1
87
+ with :
88
+ jobs : ${{ toJSON(needs) }}
89
+
90
+ tests-softhsm :
91
+ name : Run tests against SoftHSM
92
+ continue-on-error : true
93
+ strategy :
94
+ matrix :
95
+ target :
96
+ - x86_64-unknown-linux-gnu
97
+ - i686-unknown-linux-gnu
98
+ - aarch64-unknown-linux-gnu
99
+ toolchain :
100
+ - stable
101
+ - " 1.77" # MSRV
102
+ include :
103
+ - target : x86_64-unknown-linux-gnu
104
+ runner : ubuntu-latest
105
+ - target : i686-unknown-linux-gnu
106
+ runner : ubuntu-latest
107
+ - target : aarch64-unknown-linux-gnu
108
+ runner : ubuntu-24.04-arm
109
+ runs-on : ${{ matrix.runner }}
110
+ steps :
111
+ - uses : actions/checkout@v4
112
+ - name : Setup Rust toolchain
113
+ uses : actions-rs/toolchain@v1
114
+ with :
115
+ toolchain : ${{ matrix.toolchain }}
116
+ default : true
117
+ - name : Install SoftHSM
118
+ run : |
119
+ if [ "${{ matrix.target }}" = "i686-unknown-linux-gnu" ]; then
120
+ sudo dpkg --add-architecture i386
121
+ sudo apt-get update -y -qq
122
+ sudo apt-get install -y -qq gcc-multilib:i386 libsofthsm2:i386 gcc:i386
123
+ else
124
+ sudo apt-get update -y -qq
125
+ sudo apt-get install -y -qq libsofthsm2
126
+ fi
127
+ mkdir /tmp/tokens
128
+ echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf
129
+ - name : Install Rust target
130
+ run : rustup target add ${{ matrix.target }}
131
+ - name : Check
132
+ run : cargo check --target ${{ matrix.target }} --workspace --all-targets
133
+ - name : Test script
134
+ env :
135
+ TEST_PKCS11_MODULE : /usr/lib/softhsm/libsofthsm2.so
136
+ SOFTHSM2_CONF : /tmp/softhsm2.conf
137
+ RUSTFLAGS : " -D warnings"
138
+ run : RUST_BACKTRACE=1 cargo test --target ${{ matrix.target }}
43
139
44
140
build-windows :
45
141
name : Build on Windows
@@ -65,27 +161,14 @@ jobs:
65
161
RUST_BACKTRACE=1 cargo build --all-features &&
66
162
RUST_BACKTRACE=1 cargo test
67
163
68
-
69
- build-msrv :
70
- name : MSRV - Execute CI script
71
- runs-on : ubuntu-latest
72
- steps :
73
- - uses : actions/checkout@v4
74
- - name : Setup Rust toolchain on MSRV
75
- uses : actions-rs/toolchain@v1
76
- with :
77
- toolchain : 1.66.0
78
- - name : " Installs SoftHSM and execute tests"
79
- uses : ./.github/actions/ci_script
80
-
81
164
links :
82
165
name : Check links
83
166
runs-on : ubuntu-latest
84
167
steps :
85
- - uses : actions/checkout@v4
86
- - name : Link Checker
87
- uses : peter-evans/link-checker@v1
88
- with :
89
- args : -v -r *.md
90
- - name : Fail if there were link errors
91
- run : exit ${{ steps.lc.outputs.exit_code }}
168
+ - uses : actions/checkout@v4
169
+ - name : Link Checker
170
+ uses : peter-evans/link-checker@v1
171
+ with :
172
+ args : -v -r *.md
173
+ - name : Fail if there were link errors
174
+ run : exit ${{ steps.lc.outputs.exit_code }}
0 commit comments