Skip to content

Commit 0b242ba

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

File tree

3 files changed

+38
-60
lines changed

3 files changed

+38
-60
lines changed

.github/actions/ci_script/action.yml

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

.github/workflows/ci.yml

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

4472
tests-kryoptic:
4573
name: Run tests against Kryoptic
@@ -58,7 +86,6 @@ jobs:
5886
RUST_BACKTRACE=1 cargo build --all-features &&
5987
RUST_BACKTRACE=1 cargo test
6088
61-
6289
build-msrv:
6390
name: MSRV - Execute CI script
6491
runs-on: ubuntu-latest
@@ -75,10 +102,10 @@ jobs:
75102
name: Check links
76103
runs-on: ubuntu-latest
77104
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 }}
105+
- uses: actions/checkout@v4
106+
- name: Link Checker
107+
uses: peter-evans/link-checker@v1
108+
with:
109+
args: -v -r *.md
110+
- name: Fail if there were link errors
111+
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)