2
0

rng-tools.yml 3.2 KB

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