From e476b926a3337170271b3fb4b068d42c9d9afd44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Mon, 13 Nov 2023 15:28:42 +0000 Subject: [PATCH] ci.yml: Add a job for runnning tests on MSRV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomás González --- .github/actions/ci_script/action.yml | 36 +++++++++++++++++++++++++ .github/workflows/ci.yml | 40 +++++++++------------------- 2 files changed, 49 insertions(+), 27 deletions(-) create mode 100644 .github/actions/ci_script/action.yml diff --git a/.github/actions/ci_script/action.yml b/.github/actions/ci_script/action.yml new file mode 100644 index 00000000..679471bf --- /dev/null +++ b/.github/actions/ci_script/action.yml @@ -0,0 +1,36 @@ +name: "CI script Tests" +description: "Installs SoftHSM and executes tests" + +runs: + using: "composite" + steps: + - 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 + shell: bash + + - name: Install Rust targets + run: | + rustup target add armv7-unknown-linux-gnueabi && + rustup target add armv7-unknown-linux-gnueabihf && + rustup target add arm-unknown-linux-gnueabi && + rustup target add aarch64-unknown-linux-gnu && + rustup target add i686-unknown-linux-gnu && + rustup target add loongarch64-unknown-linux-gnu && + rustup target add powerpc64-unknown-linux-gnu && + rustup target add powerpc64le-unknown-linux-gnu && + rustup target add x86_64-pc-windows-msvc && + rustup target add x86_64-apple-darwin && + rustup target add aarch64-apple-darwin && + rustup target add x86_64-unknown-freebsd + shell: bash + + - name: Test script + env: + PKCS11_SOFTHSM2_MODULE: /usr/lib/softhsm/libsofthsm2.so + SOFTHSM2_CONF: /tmp/softhsm2.conf + run: ./ci.sh + shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bd2026b..5e2e4a56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,34 +38,20 @@ jobs: uses: actions-rs/toolchain@v1 with: toolchain: stable + - name: "Installs SoftHSM and execute tests" + uses: ./.github/actions/ci_script - - 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 targets - run: | - rustup target add armv7-unknown-linux-gnueabi && - rustup target add armv7-unknown-linux-gnueabihf && - rustup target add arm-unknown-linux-gnueabi && - rustup target add aarch64-unknown-linux-gnu && - rustup target add i686-unknown-linux-gnu && - rustup target add loongarch64-unknown-linux-gnu && - rustup target add powerpc64-unknown-linux-gnu && - rustup target add powerpc64le-unknown-linux-gnu && - rustup target add x86_64-pc-windows-msvc && - rustup target add x86_64-apple-darwin && - rustup target add aarch64-apple-darwin && - rustup target add x86_64-unknown-freebsd - - - name: Test script - env: - PKCS11_SOFTHSM2_MODULE: /usr/lib/softhsm/libsofthsm2.so - SOFTHSM2_CONF: /tmp/softhsm2.conf - run: ./ci.sh + build-msrv: + name: MSRV - Execute CI script + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - 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