|
| 1 | +name: IPMItool Tests |
| 2 | + |
| 3 | +# START OF COMMON SECTION |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ 'master', 'main', 'release/**' ] |
| 7 | + pull_request: |
| 8 | + branches: [ '*' ] |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
| 13 | +# END OF COMMON SECTION |
| 14 | + |
| 15 | +jobs: |
| 16 | + build_wolfprovider: |
| 17 | + name: Build wolfProvider |
| 18 | + runs-on: ubuntu-22.04 |
| 19 | + timeout-minutes: 20 |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + wolfssl_ref: [ 'master', 'v5.7.4-stable' ] |
| 23 | + steps: |
| 24 | + - name: Checkout wolfProvider |
| 25 | + uses: actions/checkout@v4 |
| 26 | + |
| 27 | + # Check if this version of wolfssl/wolfprovider has already been built, |
| 28 | + # mark to cache these items on post if we do end up building |
| 29 | + - name: Checking wolfSSL/wolfProvider in cache |
| 30 | + uses: actions/cache@v4 |
| 31 | + id: wolfprov-cache |
| 32 | + with: |
| 33 | + path: | |
| 34 | + wolfssl-source |
| 35 | + wolfssl-install |
| 36 | + wolfprov-install |
| 37 | + provider.conf |
| 38 | +
|
| 39 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }} |
| 40 | + lookup-only: true |
| 41 | + |
| 42 | + # If wolfssl/wolfprovider have not yet been built, pull ossl from cache |
| 43 | + - name: Checking OpenSSL in cache |
| 44 | + if: steps.wolfprov-cache.outputs.cache-hit != 'true' |
| 45 | + uses: actions/cache@v4 |
| 46 | + id: openssl-cache |
| 47 | + with: |
| 48 | + path: | |
| 49 | + openssl-source |
| 50 | + openssl-install |
| 51 | +
|
| 52 | + key: ossl-depends |
| 53 | + fail-on-cache-miss: false |
| 54 | + |
| 55 | + # If not yet built this version, build it now |
| 56 | + - name: Build wolfProvider |
| 57 | + if: steps.wolfprov-cache.outputs.cache-hit != 'true' |
| 58 | + run: | |
| 59 | + WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh |
| 60 | +
|
| 61 | + - name: Print errors |
| 62 | + if: ${{ failure() }} |
| 63 | + run: | |
| 64 | + if [ -f test-suite.log ] ; then |
| 65 | + cat test-suite.log |
| 66 | + fi |
| 67 | +
|
| 68 | + test_ipmitool: |
| 69 | + runs-on: ubuntu-22.04 |
| 70 | + needs: build_wolfprovider |
| 71 | + # This should be a safe limit for the tests to run. |
| 72 | + timeout-minutes: 20 |
| 73 | + strategy: |
| 74 | + fail-fast: false |
| 75 | + matrix: |
| 76 | + git_ref: [ c3939dac2c060651361fc71516806f9ab8c38901 ] |
| 77 | + wolfssl_ref: [ 'master', 'v5.7.4-stable' ] |
| 78 | + steps: |
| 79 | + - name: Retrieving OpenSSL from cache |
| 80 | + uses: actions/cache/restore@v4 |
| 81 | + id: openssl-cache |
| 82 | + with: |
| 83 | + path: | |
| 84 | + openssl-source |
| 85 | + openssl-install |
| 86 | +
|
| 87 | + key: ossl-depends |
| 88 | + fail-on-cache-miss: false |
| 89 | + |
| 90 | + - name: Retrieving wolfSSL/wolfProvider from cache |
| 91 | + uses: actions/cache/restore@v4 |
| 92 | + id: wolfprov-cache |
| 93 | + with: |
| 94 | + path: | |
| 95 | + wolfssl-source |
| 96 | + wolfssl-install |
| 97 | + wolfprov-install |
| 98 | + provider.conf |
| 99 | +
|
| 100 | + key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }} |
| 101 | + fail-on-cache-miss: true |
| 102 | + |
| 103 | + - name: Install dependencies |
| 104 | + run: | |
| 105 | + export DEBIAN_FRONTEND=noninteractive |
| 106 | + sudo apt-get update |
| 107 | + sudo apt-get install -y libreadline-dev |
| 108 | +
|
| 109 | + - name: Build ipmitool with wolfProvider |
| 110 | + uses: wolfSSL/actions-build-autotools-project@v1 |
| 111 | + with: |
| 112 | + repository: ipmitool/ipmitool |
| 113 | + ref: ${{ matrix.git_ref }} |
| 114 | + path: ipmitool |
| 115 | + configure: --with-openssl=$GITHUB_WORKSPACE/openssl-install |
| 116 | + check: false |
| 117 | + |
| 118 | + - name: Confirm built with OpenSSL and test with wolfProvider |
| 119 | + working-directory: ipmitool |
| 120 | + run: | |
| 121 | + # Setup environment for wolfProvider |
| 122 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64 |
| 123 | + export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf |
| 124 | + export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib |
| 125 | +
|
| 126 | + # Verify ipmitool was built and linked correctly with OpenSSL |
| 127 | + ldd src/ipmitool | grep -E '(libssl|libcrypto)' |
| 128 | + ldd src/ipmievd | grep -E '(libssl|libcrypto)' |
| 129 | +
|
| 130 | + # Run a simple command to verify functionality |
| 131 | + ./src/ipmitool -V |
0 commit comments