Skip to content

Commit b3132ab

Browse files
committed
Build and test in a matrix
Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
1 parent 68813c6 commit b3132ab

File tree

3 files changed

+42
-73
lines changed

3 files changed

+42
-73
lines changed

.github/actions/ci_script/action.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,45 @@ jobs:
3232
build:
3333
name: Execute CI script
3434
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
target:
38+
- armv7-unknown-linux-gnueabi
39+
- armv7-unknown-linux-gnueabihf
40+
- arm-unknown-linux-gnueabi
41+
- aarch64-unknown-linux-gnu
42+
- i686-unknown-linux-gnu
43+
- loongarch64-unknown-linux-gnu
44+
- powerpc64-unknown-linux-gnu
45+
- powerpc64le-unknown-linux-gnu
46+
- x86_64-pc-windows-msvc
47+
- x86_64-apple-darwin
48+
- aarch64-apple-darwin
49+
- x86_64-unknown-freebsd
50+
- riscv64gc-unknown-linux-gnu
51+
toolchain:
52+
- stable
53+
- "1.66.0" # MSRV
3554
steps:
3655
- uses: actions/checkout@v4
3756
- name: Setup Rust toolchain
3857
uses: actions-rs/toolchain@v1
3958
with:
40-
toolchain: stable
41-
- name: "Installs SoftHSM and execute tests"
42-
uses: ./.github/actions/ci_script
59+
toolchain: ${{ matrix.toolchain }}
60+
- name: Install SoftHSM
61+
run: |
62+
sudo apt-get update -y -qq &&
63+
sudo apt-get install -y -qq libsofthsm2 &&
64+
mkdir /tmp/tokens
65+
echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf
66+
- name: Install Rust target
67+
run: rustup target add ${{ matrix.target }}
68+
- name: Test script
69+
env:
70+
TEST_PKCS11_MODULE: /usr/lib/softhsm/libsofthsm2.so
71+
SOFTHSM2_CONF: /tmp/softhsm2.conf
72+
TARGET: ${{ matrix.target }}
73+
run: ./ci.sh
4374

4475
tests-kryoptic:
4576
name: Run tests against Kryoptic
@@ -58,27 +89,14 @@ jobs:
5889
RUST_BACKTRACE=1 cargo build --all-features &&
5990
RUST_BACKTRACE=1 cargo test
6091
61-
62-
build-msrv:
63-
name: MSRV - Execute CI script
64-
runs-on: ubuntu-latest
65-
steps:
66-
- uses: actions/checkout@v4
67-
- name: Setup Rust toolchain on MSRV
68-
uses: actions-rs/toolchain@v1
69-
with:
70-
toolchain: 1.66.0
71-
- name: "Installs SoftHSM and execute tests"
72-
uses: ./.github/actions/ci_script
73-
7492
links:
7593
name: Check links
7694
runs-on: ubuntu-latest
7795
steps:
78-
- uses: actions/checkout@v4
79-
- name: Link Checker
80-
uses: peter-evans/link-checker@v1
81-
with:
82-
args: -v -r *.md
83-
- name: Fail if there were link errors
84-
run: exit ${{ steps.lc.outputs.exit_code }}
96+
- uses: actions/checkout@v4
97+
- name: Link Checker
98+
uses: peter-evans/link-checker@v1
99+
with:
100+
args: -v -r *.md
101+
- name: Fail if there were link errors
102+
run: exit ${{ steps.lc.outputs.exit_code }}

ci.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@ RUST_BACKTRACE=1 cargo build
2323

2424
RUST_BACKTRACE=1 cargo build --all-features
2525

26-
RUST_BACKTRACE=1 cargo build --target arm-unknown-linux-gnueabi
27-
RUST_BACKTRACE=1 cargo build --target armv7-unknown-linux-gnueabi
28-
RUST_BACKTRACE=1 cargo build --target armv7-unknown-linux-gnueabihf
29-
RUST_BACKTRACE=1 cargo build --target aarch64-unknown-linux-gnu
30-
RUST_BACKTRACE=1 cargo build --target i686-unknown-linux-gnu
31-
RUST_BACKTRACE=1 cargo build --target loongarch64-unknown-linux-gnu
32-
RUST_BACKTRACE=1 cargo build --target powerpc64-unknown-linux-gnu
33-
RUST_BACKTRACE=1 cargo build --target powerpc64le-unknown-linux-gnu
34-
RUST_BACKTRACE=1 cargo build --target riscv64gc-unknown-linux-gnu
35-
RUST_BACKTRACE=1 cargo build --target x86_64-pc-windows-msvc
36-
RUST_BACKTRACE=1 cargo build --target x86_64-apple-darwin
37-
RUST_BACKTRACE=1 cargo build --target aarch64-apple-darwin
38-
RUST_BACKTRACE=1 cargo build --target x86_64-unknown-freebsd
26+
RUST_BACKTRACE=1 cargo build --target "$TARGET"
3927

4028
RUST_BACKTRACE=1 cargo test

0 commit comments

Comments
 (0)