|
| 1 | +name: Altera Agilex 5 FCS port tests |
| 2 | + |
| 3 | +# START OF COMMON SECTION |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ 'release/**' ] |
| 7 | + pull_request: |
| 8 | + types: [opened, synchronize, reopened, ready_for_review] |
| 9 | + branches: [ '*' ] |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | +# END OF COMMON SECTION |
| 18 | + |
| 19 | +# The stub exposes only the libfcs interface and always reports unavailable |
| 20 | +# hardware. This checks port compilation, build guards, linkage, and software |
| 21 | +# fallback without treating host output as SDM cryptographic validation. |
| 22 | +# Functional offload remains covered by wolfcrypttest on Agilex 5 hardware. |
| 23 | + |
| 24 | +jobs: |
| 25 | + build: |
| 26 | + name: ${{ matrix.name }} |
| 27 | + if: ${{ (github.repository_owner == 'wolfssl') && (github.event_name != 'pull_request' || github.event.pull_request.draft == false) }} |
| 28 | + runs-on: ubuntu-24.04 |
| 29 | + timeout-minutes: 15 |
| 30 | + strategy: |
| 31 | + fail-fast: false |
| 32 | + matrix: |
| 33 | + include: |
| 34 | + - name: Autotools all algorithms |
| 35 | + system: autotools |
| 36 | + option: all |
| 37 | + extra: --enable-aesctr |
| 38 | + - name: Autotools RNG only |
| 39 | + system: autotools |
| 40 | + option: rng |
| 41 | + extra: '' |
| 42 | + - name: Autotools without ECC |
| 43 | + system: autotools |
| 44 | + option: all |
| 45 | + extra: --enable-aesctr --disable-ecc |
| 46 | + - name: CMake all algorithms |
| 47 | + system: cmake |
| 48 | + option: all |
| 49 | + extra: '' |
| 50 | + - name: CMake RNG only |
| 51 | + system: cmake |
| 52 | + option: rng |
| 53 | + extra: '' |
| 54 | + |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v5 |
| 57 | + name: Checkout wolfSSL |
| 58 | + |
| 59 | + - name: Install dependencies |
| 60 | + uses: ./.github/actions/install-apt-deps |
| 61 | + with: |
| 62 | + packages: autoconf automake libtool build-essential cmake |
| 63 | + ghcr-debs-tag: ubuntu-24.04-minimal |
| 64 | + |
| 65 | + - name: Build no-hardware dependency stubs |
| 66 | + run: | |
| 67 | + stub="$RUNNER_TEMP/altera-fcs-stub" |
| 68 | + mkdir -p "$stub/include" "$stub/lib" |
| 69 | + cp tests/altera-fcs-stub/libfcs.h \ |
| 70 | + tests/altera-fcs-stub/libfcs_osal_types.h "$stub/include/" |
| 71 | + cc -I"$stub/include" -c \ |
| 72 | + tests/altera-fcs-stub/libfcs_stub.c -o "$stub/libfcs_stub.o" |
| 73 | + ar rcs "$stub/lib/libFCS.a" "$stub/libfcs_stub.o" |
| 74 | + cc -c tests/altera-fcs-stub/fdt_stub.c -o "$stub/fdt_stub.o" |
| 75 | + ar rcs "$stub/lib/libfdt.a" "$stub/fdt_stub.o" |
| 76 | + echo "ALTERA_FCS_STUB=$stub" >> "$GITHUB_ENV" |
| 77 | +
|
| 78 | + - name: Build and test with Autotools |
| 79 | + if: matrix.system == 'autotools' |
| 80 | + run: | |
| 81 | + set -o pipefail |
| 82 | + ./autogen.sh |
| 83 | + CPPFLAGS="-I$ALTERA_FCS_STUB/include" \ |
| 84 | + LDFLAGS="-L$ALTERA_FCS_STUB/lib" \ |
| 85 | + ./configure --enable-alterafcs=${{ matrix.option }} \ |
| 86 | + --disable-shared ${{ matrix.extra }} |
| 87 | + make -j"$(nproc)" |
| 88 | + ./wolfcrypt/test/testwolfcrypt | tee altera-fcs-test.log |
| 89 | + grep -q 'ALTERA-FCS test skipped: hardware unavailable' \ |
| 90 | + altera-fcs-test.log |
| 91 | +
|
| 92 | + - name: Build and test with CMake |
| 93 | + if: matrix.system == 'cmake' |
| 94 | + run: | |
| 95 | + set -o pipefail |
| 96 | + cmake -S . -B build \ |
| 97 | + -DWOLFSSL_ALTERA_FCS=${{ matrix.option }} \ |
| 98 | + -DALTERA_FCS_INCLUDE_DIR="$ALTERA_FCS_STUB/include" \ |
| 99 | + -DALTERA_FCS_OSAL_INCLUDE_DIR="$ALTERA_FCS_STUB/include" \ |
| 100 | + -DALTERA_FCS_LIBRARY="$ALTERA_FCS_STUB/lib/libFCS.a" \ |
| 101 | + -DALTERA_FDT_LIBRARY="$ALTERA_FCS_STUB/lib/libfdt.a" |
| 102 | + cmake --build build --target wolfcrypttest -j"$(nproc)" |
| 103 | + ./build/wolfcrypt/test/testwolfcrypt | tee altera-fcs-test.log |
| 104 | + grep -q 'ALTERA-FCS test skipped: hardware unavailable' \ |
| 105 | + altera-fcs-test.log |
0 commit comments