Skip to content

Multi-Compiler

Multi-Compiler #275

name: Multi-Compiler
on:
push:
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
discover:
uses: ./.github/workflows/_resolve-wolfssl.yml
compilers:
name: ${{ matrix.cc }} (wolfSSL ${{ matrix.wolfssl-ref }})
needs: discover
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cc: [gcc-11, gcc-12, gcc-13, clang-14, clang-15, clang-17]
wolfssl-ref: ${{ fromJson(needs.discover.outputs.refs) }}
steps:
- uses: actions/checkout@v4
- name: Install compiler
run: |
sudo apt-get update
sudo apt-get install -y autoconf automake libtool ${{ matrix.cc }}
- name: Cache wolfSSL (${{ matrix.wolfssl-ref }})
if: matrix.wolfssl-ref != 'master'
id: cache-wolfssl
uses: actions/cache@v4
with:
path: ~/wolfssl-install
key: wolfssl-multicompiler-${{ matrix.wolfssl-ref }}-v1
- name: Build wolfSSL (${{ matrix.wolfssl-ref }})
if: matrix.wolfssl-ref == 'master' || steps.cache-wolfssl.outputs.cache-hit != 'true'
run: |
cd ~
git clone --depth 1 --branch ${{ matrix.wolfssl-ref }} \
https://github.com/wolfSSL/wolfssl.git
cd wolfssl
./autogen.sh
# PQC (ML-DSA wc_MlDsaKey) only on master or stable newer than v5.9.1.
REF="${{ matrix.wolfssl-ref }}"
if [ "$REF" = "master" ] || \
[ "$(printf '%s\n%s\n' v5.9.1-stable "$REF" | sort -V | tail -n1)" != "v5.9.1-stable" ]; then
PQC_FLAGS="--enable-mldsa"
else
PQC_FLAGS=""
fi
./configure --enable-ecc --enable-ed25519 --enable-ed448 \
--enable-curve25519 --enable-aesgcm --enable-aesccm \
--enable-sha384 --enable-sha512 --enable-keygen \
--enable-rsapss --enable-chacha --enable-poly1305 \
$PQC_FLAGS \
--prefix=$HOME/wolfssl-install
make -j$(nproc)
make install
- name: Build wolfCOSE
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
make CC=${{ matrix.cc }} \
CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"
- name: Run unit tests
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make test CC=${{ matrix.cc }} \
CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"