Skip to content

Build and test in a matrix #859

Build and test in a matrix

Build and test in a matrix #859

Workflow file for this run

name: Continuous Integration
on: [push, pull_request, workflow_dispatch]
jobs:
# Use the following command to fix words locally:
# codespell --write-changes
check-spelling:
name: Check spelling
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check spelling
uses: codespell-project/actions-codespell@v1
formatting:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check formatting
run: cargo fmt --all -- --check
docs:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check documentation
run: RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items --no-deps
build:
name: Execute CI script
runs-on: ubuntu-latest
strategy:
matrix:
include:
- target: armv7-unknown-linux-gnueabi
- target: armv7-unknown-linux-gnueabihf
- target: arm-unknown-linux-gnueabi
- target: aarch64-unknown-linux-gnu
- target: i686-unknown-linux-gnu
- target: loongarch64-unknown-linux-gnu
- target: powerpc64-unknown-linux-gnu
- target: powerpc64le-unknown-linux-gnu
- target: x86_64-pc-windows-msvc
- target: x86_64-apple-darwin
- target: aarch64-apple-darwin
- target: x86_64-unknown-freebsd
- target: riscv64gc-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install SoftHSM
run: |
sudo apt-get update -y -qq &&
sudo apt-get install -y -qq libsofthsm2 &&
mkdir /tmp/tokens
echo "directories.tokendir = /tmp/tokens" > /tmp/softhsm2.conf
- name: Install Rust target
run: rustup target add ${{ matrix.target }}
- name: Test script
env:
TEST_PKCS11_MODULE: /usr/lib/softhsm/libsofthsm2.so
SOFTHSM2_CONF: /tmp/softhsm2.conf
TARGET: ${{ matrix.target }}
run: ./ci.sh
tests-kryoptic:
name: Run tests against Kryoptic
runs-on: ubuntu-latest
container: fedora:rawhide
steps:
- name: Install dependencies
run: dnf -y install git cargo clang-devel kryoptic
- uses: actions/checkout@v4
- name: Test script
env:
KRYOPTIC_CONF: /tmp/kryoptic.sql
TEST_PKCS11_MODULE: /usr/lib64/pkcs11/libkryoptic_pkcs11.so
run: |
RUST_BACKTRACE=1 cargo build &&
RUST_BACKTRACE=1 cargo build --all-features &&
RUST_BACKTRACE=1 cargo test
build-msrv:
name: MSRV - Execute CI script
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain on MSRV
uses: actions-rs/toolchain@v1
with:
toolchain: 1.66.0
- name: "Installs SoftHSM and execute tests"
uses: ./.github/actions/ci_script
links:
name: Check links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Link Checker
uses: peter-evans/link-checker@v1
with:
args: -v -r *.md
- name: Fail if there were link errors
run: exit ${{ steps.lc.outputs.exit_code }}