rng-tools.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. name: rng-tools 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
  26. install: true
  27. check: false
  28. - name: tar build-dir
  29. run: tar -zcf build-dir.tgz build-dir
  30. - name: Upload built lib
  31. uses: actions/upload-artifact@v4
  32. with:
  33. name: wolf-install-rng-tools
  34. path: build-dir.tgz
  35. retention-days: 5
  36. rng-tools_check:
  37. strategy:
  38. fail-fast: false
  39. matrix:
  40. # List of releases to test
  41. ref: [ 6.16 ]
  42. name: ${{ matrix.ref }}
  43. if: github.repository_owner == 'wolfssl'
  44. runs-on: ubuntu-22.04
  45. # This should be a safe limit for the tests to run.
  46. timeout-minutes: 4
  47. needs: build_wolfssl
  48. steps:
  49. - name: Install dependencies
  50. run: |
  51. # Don't prompt for anything
  52. export DEBIAN_FRONTEND=noninteractive
  53. sudo apt-get update
  54. sudo apt-get install -y libcurl4-openssl-dev libjansson-dev libp11-dev librtlsdr-dev libcap-dev
  55. - name: Download lib
  56. uses: actions/download-artifact@v4
  57. with:
  58. name: wolf-install-rng-tools
  59. - name: untar build-dir
  60. run: tar -xf build-dir.tgz
  61. - name: Checkout OSP
  62. uses: actions/checkout@v4
  63. with:
  64. repository: wolfssl/osp
  65. path: osp
  66. - name: Checkout jitterentropy-library
  67. uses: actions/checkout@v4
  68. with:
  69. repository: smuellerDD/jitterentropy-library
  70. path: jitterentropy-library
  71. ref: v3.5.0
  72. - name: Build jitterentropy-library
  73. working-directory: jitterentropy-library
  74. run: make -j
  75. - name: Build rng-tools
  76. uses: wolfSSL/actions-build-autotools-project@v1
  77. with:
  78. repository: nhorman/rng-tools
  79. ref: v${{ matrix.ref }}
  80. path: rng-tools
  81. patch-file: $GITHUB_WORKSPACE/osp/rng-tools/${{ matrix.ref }}.patch
  82. configure: --without-pkcs11 --enable-jitterentropy=$GITHUB_WORKSPACE/jitterentropy-library --with-wolfssl=$GITHUB_WORKSPACE/build-dir
  83. check: false
  84. - name: Testing rng-tools
  85. id: testing
  86. working-directory: rng-tools
  87. run: |
  88. # Retry up to five times
  89. for i in {1..5}; do
  90. TEST_RES=0
  91. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib make check || TEST_RES=$?
  92. if [ "$TEST_RES" -eq "0" ]; then
  93. break
  94. fi
  95. done
  96. if [ "$TEST_RES" -ne "0" ]; then
  97. exit $TEST_RES
  98. fi
  99. - name: Print logs
  100. if: ${{ failure() && steps.testing.outcome == 'failure' }}
  101. working-directory: rng-tools/tests
  102. run: cat test-suite.log