CMake improvements (add TPM module choice) - sync to configure #535
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: WolfTPM CMake Build Tests | |
| on: | |
| push: | |
| branches: [ 'master', 'main', 'release/**' ] | |
| pull_request: | |
| branches: [ '*' ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| # Default configuration (SWTPM first) | |
| - name: "Defaults" | |
| options: "" | |
| # ST33 supports both SPI and I2C | |
| - name: "Module ST33 SPI" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=st33" | |
| - name: "Module ST33 I2C" | |
| options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_MODULE=st33" | |
| # Other modules use SPI | |
| - name: "Module Microchip" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=microchip" | |
| - name: "Module Nuvoton" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=nuvoton" | |
| - name: "Module SLB9670" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=slb9670" | |
| - name: "Module SLB9672" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_MODULE=slb9672" | |
| # SLB9673 is I2C | |
| - name: "Module SLB9673 I2C" | |
| options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_MODULE=slb9673" | |
| # Test wrapper disabled | |
| - name: "No Wrapper" | |
| options: "-DWOLFTPM_WRAPPER=no" | |
| # Test I2C support (enables ADV_IO automatically) | |
| - name: "I2C Enabled (legacy)" | |
| options: "-DWOLFTPM_I2C=yes" | |
| # Test interface options | |
| - name: "Interface I2C" | |
| options: "-DWOLFTPM_INTERFACE=I2C" | |
| - name: "Interface SPI" | |
| options: "-DWOLFTPM_INTERFACE=SPI" | |
| # Test Advanced IO | |
| - name: "Advanced IO" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_ADVIO=yes" | |
| - name: "Advanced IO I2C" | |
| options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_ADVIO=yes" | |
| # Test MMIO (enables ADV_IO automatically) | |
| - name: "MMIO Enabled" | |
| options: "-DWOLFTPM_MMIO=yes" | |
| # Test Check Wait State | |
| - name: "Check Wait State Enabled" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_CHECK_WAIT_STATE=yes" | |
| - name: "Check Wait State Disabled" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_CHECK_WAIT_STATE=no" | |
| # Test TIS Lock | |
| - name: "TIS Lock Enabled" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_TIS_LOCK=yes" | |
| # Test Small Stack | |
| - name: "Small Stack" | |
| options: "-DWOLFTPM_INTERFACE=SPI -DWOLFTPM_SMALL_STACK=yes" | |
| # Test HAL disabled | |
| - name: "No HAL" | |
| options: "-DWOLFTPM_HAL=no" | |
| # Test Firmware disabled | |
| - name: "No Firmware" | |
| options: "-DWOLFTPM_FIRMWARE=no" | |
| # Test Debug modes | |
| - name: "Debug Verbose" | |
| options: "-DWOLFTPM_DEBUG=verbose" | |
| - name: "Debug IO" | |
| options: "-DWOLFTPM_DEBUG=io" | |
| # Test Examples disabled | |
| - name: "No Examples" | |
| options: "-DWOLFTPM_EXAMPLES=no" | |
| # Test combination of options | |
| - name: "Combined Options" | |
| options: "-DWOLFTPM_INTERFACE=I2C -DWOLFTPM_MODULE=st33 -DWOLFTPM_ADVIO=yes -DWOLFTPM_CHECK_WAIT_STATE=yes" | |
| steps: | |
| #pull wolfTPM | |
| - uses: actions/checkout@master | |
| # Install cmake | |
| - name: Install cmake | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y cmake | |
| #pull and build wolfssl | |
| - name: Checkout wolfssl | |
| uses: actions/checkout@master | |
| with: | |
| repository: wolfssl/wolfssl | |
| path: wolfssl | |
| - name: Build wolfssl | |
| working-directory: ./wolfssl | |
| run: | | |
| mkdir build | |
| cd build | |
| # wolfSSL PR 7188 broke "make install" unless WOLFSSL_INSTALL is set | |
| cmake -DWOLFSSL_TPM=yes -DWOLFSSL_INSTALL=yes -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" .. | |
| cmake --build . | |
| cmake --install . | |
| #build wolftpm | |
| - name: Build wolfTPM (${{ matrix.config.name }}) | |
| run: | | |
| mkdir build | |
| cd build | |
| cmake ${{ matrix.config.options }} -DCMAKE_INSTALL_PREFIX="$GITHUB_WORKSPACE/install" -DWITH_WOLFSSL="$GITHUB_WORKSPACE/install" .. | |
| cmake --build . | |
| cmake --install . |