|
| 1 | +name: Test External Library Paths |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ 'master', 'main', 'release/**' ] |
| 6 | + pull_request: |
| 7 | + branches: [ '*' ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + test_external_libs: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + # Matrix to test multiple configurations |
| 15 | + strategy: |
| 16 | + matrix: |
| 17 | + test-config: |
| 18 | + - name: "External wolfSSL" |
| 19 | + config: "config/examples/sim.config" |
| 20 | + |
| 21 | + - name: "External wolfTPM" |
| 22 | + config: "config/examples/sim-tpm.config" |
| 23 | + build-tpm-tools: true |
| 24 | + |
| 25 | + - name: "external wolfHSM" |
| 26 | + config: "config/examples/sim-wolfHSM-client.config" |
| 27 | + |
| 28 | + - name: "Unit tests" |
| 29 | + config: "" |
| 30 | + is-unit-test: true |
| 31 | + |
| 32 | + fail-fast: false |
| 33 | + |
| 34 | + steps: |
| 35 | + # Checkout wolfBoot with submodules |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: true |
| 39 | + |
| 40 | + # Move libraries outside the wolfBoot tree |
| 41 | + - name: Relocate libraries to external path |
| 42 | + run: | |
| 43 | + echo "=== Moving libraries outside wolfBoot tree ===" |
| 44 | + mv lib ../external-libs |
| 45 | + ls -la ../external-libs/ |
| 46 | + echo "Libraries moved to ../external-libs" |
| 47 | +
|
| 48 | + # Select configuration (skip for unit tests) |
| 49 | + - name: Select config |
| 50 | + if: matrix.test-config.config != '' |
| 51 | + run: | |
| 52 | + cp ${{ matrix.test-config.config }} .config |
| 53 | + echo "=== Selected config: ${{ matrix.test-config.name }} ===" |
| 54 | +
|
| 55 | + # Build TPM tools if needed |
| 56 | + - name: Build TPM tools with external paths |
| 57 | + if: matrix.test-config.build-tpm-tools == true |
| 58 | + run: | |
| 59 | + echo "=== Building TPM tools with external paths ===" |
| 60 | + make tpmtools \ |
| 61 | + WOLFBOOT_LIB_WOLFSSL=$(realpath ../external-libs/wolfssl) \ |
| 62 | + WOLFBOOT_LIB_WOLFTPM=$(realpath ../external-libs/wolfTPM) |
| 63 | +
|
| 64 | + # Build main target (skip for unit tests) |
| 65 | + - name: Build wolfBoot with external library paths |
| 66 | + if: matrix.test-config.is-unit-test != true |
| 67 | + run: | |
| 68 | + echo "=== Building wolfBoot with external paths ===" |
| 69 | + make clean |
| 70 | + make \ |
| 71 | + WOLFBOOT_LIB_WOLFSSL="$(realpath ../external-libs/wolfssl)" \ |
| 72 | + WOLFBOOT_LIB_WOLFTPM="$(realpath ../external-libs/wolfTPM)" \ |
| 73 | + WOLFBOOT_LIB_WOLFPKCS11="$(realpath ../external-libs/wolfPKCS11)" \ |
| 74 | + WOLFBOOT_LIB_WOLFHSM="$(realpath ../external-libs/wolfHSM)" |
| 75 | +
|
| 76 | + # If building unit tests, install libcheck |
| 77 | + - name: install libcheck |
| 78 | + if: matrix.test-config.is-unit-test == true |
| 79 | + run: sudo apt-get install --no-install-recommends -y -q check |
| 80 | + |
| 81 | + |
| 82 | + # Build unit tests with external paths |
| 83 | + - name: Build unit tests with external library paths |
| 84 | + if: matrix.test-config.is-unit-test == true |
| 85 | + run: | |
| 86 | + echo "=== Building unit tests with external paths ===" |
| 87 | + make -C tools/unit-tests \ |
| 88 | + WOLFBOOT_LIB_WOLFSSL="$(realpath ../external-libs/wolfssl)" \ |
| 89 | + WOLFBOOT_LIB_WOLFPKCS11="$(realpath ../external-libs/wolfPKCS11)" |
0 commit comments