mosquitto.yml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. name: mosquitto 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-mosquitto CFLAGS="-DALLOW_INVALID_CERTSIGN"
  25. install: true
  26. - name: tar build-dir
  27. run: tar -zcf build-dir.tgz build-dir
  28. - name: Upload built lib
  29. uses: actions/upload-artifact@v4
  30. with:
  31. name: wolf-install-mosquitto
  32. path: build-dir.tgz
  33. retention-days: 5
  34. mosquitto_check:
  35. strategy:
  36. fail-fast: false
  37. matrix:
  38. ref: [ 2.0.18 ]
  39. name: ${{ matrix.ref }}
  40. runs-on: ubuntu-latest
  41. # This should be a safe limit for the tests to run.
  42. timeout-minutes: 4
  43. needs: build_wolfssl
  44. steps:
  45. - name: Download lib
  46. uses: actions/download-artifact@v4
  47. with:
  48. name: wolf-install-mosquitto
  49. - name: untar build-dir
  50. run: tar -xf build-dir.tgz
  51. - name: Checkout OSP
  52. uses: actions/checkout@v4
  53. with:
  54. repository: wolfssl/osp
  55. path: osp
  56. - name: Install dependencies
  57. run: |
  58. export DEBIAN_FRONTEND=noninteractive
  59. sudo apt-get update
  60. sudo apt-get install -y build-essential libev-dev libssl-dev automake python3-docutils libcunit1 libcunit1-doc libcunit1-dev pkg-config make
  61. sudo pip install --upgrade psutil
  62. - name: Checkout mosquitto
  63. uses: actions/checkout@v4
  64. with:
  65. repository: eclipse/mosquitto
  66. ref: v${{ matrix.ref }}
  67. path: mosquitto
  68. - name: Configure and build mosquitto
  69. run: |
  70. cd $GITHUB_WORKSPACE/mosquitto/
  71. patch -p1 < $GITHUB_WORKSPACE/osp/mosquitto/${{ matrix.ref }}.patch
  72. make WITH_TLS=wolfssl WITH_CJSON=no WITH_DOCS=no WOLFSSLDIR=$GITHUB_WORKSPACE/build-dir
  73. - name: Run mosquitto tests
  74. working-directory: ./mosquitto
  75. run: |
  76. # Retry up to five times
  77. for i in {1..5}; do
  78. TEST_RES=0
  79. make WITH_TLS=wolfssl WITH_CJSON=no WITH_DOCS=no WOLFSSLDIR=$GITHUB_WORKSPACE/build-dir ptest || TEST_RES=$?
  80. if [ "$TEST_RES" -eq "0" ]; then
  81. break
  82. fi
  83. done
  84. if [ "$TEST_RES" -ne "0" ]; then
  85. exit $TEST_RES
  86. fi