wolfBoot/.github/workflows/test-library.yml

58 lines
1.8 KiB
YAML

name: wolfBoot as Library test
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
test-lib:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
math: [SPMATH=1 WOLFBOOT_SMALL_STACK=0,
SPMATH=1 WOLFBOOT_SMALL_STACK=1,
SPMATHALL=1 WOLFBOOT_SMALL_STACK=0,
SPMATHALL=1 WOLFBOOT_SMALL_STACK=1,
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=0,
SPMATH=0 SPMATHALL=0 WOLFBOOT_SMALL_STACK=1]
asym: [ed25519, ecc256, ecc384, ecc521, rsa2048, rsa3072, rsa4096, ed448]
hash: [sha256, sha384, sha3]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: make clean
run: |
make keysclean && make -C tools/keytools clean && rm -f include/target.h
- name: Build test-lib
env:
ASYM: ${{ matrix.asym }}
HASH: ${{ matrix.hash }}
run: |
cp config/examples/library.config .config
make keytools
./tools/keytools/keygen --${{ matrix.asym }} -g wolfboot_signing_private_key.der
echo "Test" > test.bin
./tools/keytools/sign --${{ matrix.asym }} --${{ matrix.hash }} test.bin wolfboot_signing_private_key.der 1
# Convert asym and hash to upper case
make test-lib SIGN=${ASYM^^} HASH=${HASH^^}
- name: Run test-lib
run: |
./test-lib test_v1_signed.bin
./test-lib test_v1_signed.bin 2>&1 | grep "Firmware Valid"
- name: Run test-lib (expect failure)
run: |
# Corrupt signed binary
truncate -s -1 test_v1_signed.bin
echo "A" >> test_v1_signed.bin
./test-lib test_v1_signed.bin
./test-lib test_v1_signed.bin 2>&1 | grep "Failure"