libspdm.yml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: libspdm Tests
  2. # START OF COMMON SECTION
  3. on:
  4. push:
  5. branches: [ 'master', 'main', 'release/**' ]
  6. pull_request:
  7. branches: [ '*' ]
  8. concurrency:
  9. group: ${{ github.workflow }}-${{ github.ref }}
  10. cancel-in-progress: true
  11. # END OF COMMON SECTION
  12. jobs:
  13. build_wolfssl:
  14. name: Build wolfSSL
  15. if: github.repository_owner == 'wolfssl'
  16. # Just to keep it the same as the testing target
  17. runs-on: ubuntu-22.04
  18. # This should be a safe limit for the tests to run.
  19. timeout-minutes: 4
  20. steps:
  21. - name: Build wolfSSL
  22. uses: wolfSSL/actions-build-autotools-project@v1
  23. with:
  24. path: wolfssl
  25. configure: --enable-all --enable-static CFLAGS='-DRSA_MIN_SIZE=512'
  26. install: true
  27. - name: tar build-dir
  28. run: tar -zcf build-dir.tgz build-dir
  29. - name: Upload built lib
  30. uses: actions/upload-artifact@v4
  31. with:
  32. name: wolf-install-libspdm
  33. path: build-dir.tgz
  34. retention-days: 5
  35. libspdm_check:
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. # List of releases to test
  40. ref: [ 3.3.0 ]
  41. name: ${{ matrix.ref }}
  42. if: github.repository_owner == 'wolfssl'
  43. runs-on: ubuntu-22.04
  44. # This should be a safe limit for the tests to run.
  45. timeout-minutes: 4
  46. needs: build_wolfssl
  47. steps:
  48. - name: Download lib
  49. uses: actions/download-artifact@v4
  50. with:
  51. name: wolf-install-libspdm
  52. - name: untar build-dir
  53. run: tar -xf build-dir.tgz
  54. - name: Checkout OSP
  55. uses: actions/checkout@v4
  56. with:
  57. repository: wolfssl/osp
  58. path: osp
  59. - name: Checkout libspdm
  60. uses: actions/checkout@v4
  61. with:
  62. repository: DMTF/libspdm
  63. path: libspdm
  64. ref: ${{ matrix.ref }}
  65. - name: Build and test libspdm
  66. working-directory: libspdm
  67. run: |
  68. patch -p1 < ../osp/libspdm/${{ matrix.ref }}/libspdm-${{ matrix.ref }}.patch
  69. git submodule update --init --recursive
  70. # Silence cmake version warnings
  71. find -name CMakeLists.txt -exec sed -i 's/cmake_minimum_required.*/cmake_minimum_required(VERSION 3.10)/g' {} \;
  72. mkdir build
  73. cd build
  74. cmake -DARCH=x64 -DTOOLCHAIN=GCC -DTARGET=Debug -DCRYPTO=wolfssl -DENABLE_BINARY_BUILD=1 \
  75. -DCOMPILED_LIBWOLFSSL_PATH=$GITHUB_WORKSPACE/build-dir/lib/libwolfssl.a \
  76. -DWOLFSSL_INCDIR=$GITHUB_WORKSPACE/build-dir/include ..
  77. make -j
  78. cd ../unit_test/sample_key
  79. ../../build/bin/test_crypt
  80. ../../build/bin/test_spdm_secured_message
  81. ../../build/bin/test_spdm_crypt