2121 - name : Check formatting
2222 run : cargo fmt --all -- --check
2323
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+
2432 docs :
2533 name : Check documentation
2634 runs-on : ubuntu-latest
@@ -29,17 +37,105 @@ jobs:
2937 - name : Check documentation
3038 run : RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items --no-deps
3139
32- build :
33- name : Execute CI script
40+ check :
41+ name : Check for errors
3442 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
3564 steps :
3665 - uses : actions/checkout@v4
3766 - name : Setup Rust toolchain
3867 uses : actions-rs/toolchain@v1
3968 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 }}
43139
44140 build-windows :
45141 name : Build on Windows
@@ -65,27 +161,14 @@ jobs:
65161 RUST_BACKTRACE=1 cargo build --all-features &&
66162 RUST_BACKTRACE=1 cargo test
67163
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-
81164 links :
82165 name : Check links
83166 runs-on : ubuntu-latest
84167 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