Skip to content

Optimize CI for wolfProvider #2070

Optimize CI for wolfProvider

Optimize CI for wolfProvider #2070

name: Multi-Compiler Tests
# START OF COMMON SECTION
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE*'
- '.github/ISSUE_TEMPLATE/**'
- '.github/dependabot.yml'
- '.gitignore'
- 'AUTHORS'
- 'COPYING'
- 'README*'
- 'CHANGELOG*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# END OF COMMON SECTION
jobs:
build_wolfprovider:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
name: Build with compiler ${{ matrix.CC }}, wolfssl ${{ matrix.wolfssl_ref }}, OpenSSL ${{ matrix.openssl_ref }}
runs-on: ubuntu-22.04
container:
image: ghcr.io/wolfssl/wolfprovider-test-deps:bookworm
env:
DEBIAN_FRONTEND: noninteractive
timeout-minutes: 20
strategy:
fail-fast: false
# PR-time matrix is intentionally narrow: only compilers that ship
# in Debian Bookworm (the test-deps image base). Dropped vs the
# prior matrix: gcc-9, gcc-10, gcc-13, gcc-14, clang-12. Full
# cross-compiler coverage (including those) runs in the nightly
# multi-compiler job called from nightly-osp.yml.
matrix:
include:
- CC: gcc-11
CXX: g++-11
wolfssl_ref: master
openssl_ref: master
- CC: gcc-12
CXX: g++-12
wolfssl_ref: master
openssl_ref: master
- CC: gcc-12
CXX: g++-12
wolfssl_ref: v5.8.0-stable
openssl_ref: master
- CC: clang-13
CXX: clang++-13
wolfssl_ref: master
openssl_ref: master
- CC: clang-14
CXX: clang++-14
wolfssl_ref: master
openssl_ref: master
- CC: clang-15
CXX: clang++-15
wolfssl_ref: master
openssl_ref: master
steps:
- name: Checkout wolfProvider
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Get OpenSSL commit hash
id: openssl-ref
run: |
sha=$(./scripts/resolve-ref.sh "${{ matrix.openssl_ref }}" "openssl/openssl")
echo "ref=$sha" >> "$GITHUB_OUTPUT"
env:
# Used token to bypass rate limits
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get WolfSSL commit hash
id: wolfssl-ref
run: |
sha=$(./scripts/resolve-ref.sh "${{ matrix.wolfssl_ref }}" "wolfssl/wolfssl")
echo "ref=$sha" >> "$GITHUB_OUTPUT"
env:
# Used token to bypass rate limits
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Look for a cached version of OpenSSL -- with this compiler version
- name: Checking OpenSSL in cache
uses: actions/cache@v4
id: openssl-cache
with:
path: |
openssl-install
key: openssl-depends-${{ matrix.CC }}-${{ steps.openssl-ref.outputs.ref }}
lookup-only: false
# Look for a cached version of WolfSSL -- with this compiler version
- name: Checking WolfSSL in cache
uses: actions/cache@v4
id: wolfssl-cache
with:
path: |
wolfssl-install
key: wolfssl-depends-${{ matrix.CC }}-${{ steps.wolfssl-ref.outputs.ref }}
lookup-only: false
- name: Build wolfProvider
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
run: |
OPENSSL_TAG=${{ matrix.openssl_ref }} WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
- name: Print errors
if: ${{ failure() }}
run: |
if [ -f test-suite.log ]; then
cat test-suite.log
fi
if [ -f config.log ]; then
cat config.log
fi