ci.yml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. name: CI Checks
  2. on:
  3. push:
  4. branches: ["**"]
  5. pull_request:
  6. branches: ["**"]
  7. workflow_dispatch:
  8. jobs:
  9. unittest:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Clone This Repo
  13. uses: actions/checkout@v3
  14. - name: Build
  15. run: |
  16. sudo apt-get install -y lcov
  17. cmake -S test -B build/ \
  18. -G "Unix Makefiles" \
  19. -DCMAKE_BUILD_TYPE=Debug \
  20. -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG'
  21. make -C build/ all
  22. - name: Run CTests
  23. run: ctest --test-dir build -E system --output-on-failure
  24. - name: Run Coverage
  25. run: |
  26. make -C build/ coverage
  27. declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*3rdparty\*")
  28. echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
  29. lcov --rc lcov_branch_coverage=1 --list build/coverage.info
  30. - name: Check Coverage
  31. uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
  32. with:
  33. coverage-file: ./build/coverage.info
  34. complexity:
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@v3
  38. - name: Check complexity
  39. uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
  40. with:
  41. path: ./
  42. doxygen:
  43. runs-on: ubuntu-latest
  44. steps:
  45. - uses: actions/checkout@v3
  46. - name: Run doxygen build
  47. uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
  48. with:
  49. path: ./
  50. spell-check:
  51. runs-on: ubuntu-latest
  52. steps:
  53. - name: Clone This Repo
  54. uses: actions/checkout@v3
  55. - name: Run spellings check
  56. uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
  57. with:
  58. path: ./
  59. formatting:
  60. runs-on: ubuntu-20.04
  61. steps:
  62. - uses: actions/checkout@v3
  63. - name: Check formatting
  64. uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
  65. with:
  66. path: ./
  67. ssot-check:
  68. runs-on: ubuntu-latest
  69. steps:
  70. - name: Checkout this repo
  71. uses: actions/checkout@v3
  72. with:
  73. path: current
  74. - name: Checkout coreMQTT
  75. uses: actions/checkout@v3
  76. with:
  77. ref: main
  78. repository: FreeRTOS/coreMQTT
  79. path: ssot
  80. - name: Check transport_interface.h
  81. run: |
  82. SSOT_FILE="ssot/source/interface/transport_interface.h"
  83. CURRENT_FILE="current/source/interface/transport_interface.h"
  84. diff <(tail -n +3 $SSOT_FILE) <(tail -n +3 $CURRENT_FILE)
  85. if [ "$?" -ne "0" ]; then
  86. echo "transport_interface.h differs from coreMQTT."
  87. exit 1
  88. else
  89. exit 0
  90. fi
  91. git-secrets:
  92. runs-on: ubuntu-latest
  93. steps:
  94. - uses: actions/checkout@v3
  95. - name: Checkout awslabs/git-secrets
  96. uses: actions/checkout@v3
  97. with:
  98. repository: awslabs/git-secrets
  99. ref: master
  100. path: git-secrets
  101. - name: Install git-secrets
  102. run: cd git-secrets && sudo make install && cd ..
  103. - name: Run git-secrets
  104. run: |
  105. git-secrets --register-aws
  106. git-secrets --scan
  107. memory_statistics:
  108. runs-on: ubuntu-latest
  109. steps:
  110. - uses: actions/checkout@v3
  111. with:
  112. submodules: "recursive"
  113. - name: Install Python3
  114. uses: actions/setup-python@v3
  115. with:
  116. python-version: "3.11.0"
  117. - name: Measure sizes
  118. uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
  119. with:
  120. config: .github/memory_statistics_config.json
  121. check_against: docs/doxygen/include/size_table.md
  122. link-verifier:
  123. runs-on: ubuntu-latest
  124. steps:
  125. - uses: actions/checkout@v3
  126. - name: Check Links
  127. env:
  128. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  129. uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
  130. with:
  131. path: ./
  132. verify-manifest:
  133. runs-on: ubuntu-latest
  134. steps:
  135. - uses: actions/checkout@v3
  136. with:
  137. submodules: true
  138. fetch-depth: 0
  139. # At time of writing the gitmodules are set not to pull
  140. # Even when using fetch submodules. Need to run this command
  141. # To force it to grab them.
  142. - name: Perform Recursive Clone
  143. shell: bash
  144. run: git submodule update --checkout --init --recursive
  145. - name: Run manifest verifier
  146. uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
  147. with:
  148. path: ./
  149. fail-on-incorrect-version: true
  150. proof_ci:
  151. if: ${{ github.event.pull_request }}
  152. runs-on: cbmc_ubuntu-latest_64-core
  153. steps:
  154. - name: Set up CBMC runner
  155. uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main
  156. with:
  157. kissat_tag: latest
  158. cbmc_version: "5.73.0"
  159. - run: |
  160. git submodule update --init --recursive --checkout
  161. sudo apt-get update
  162. sudo apt-get install --yes --no-install-recommends gcc-multilib build-essential
  163. - name: Run CBMC
  164. uses: FreeRTOS/CI-CD-Github-Actions/run_cbmc@main
  165. with:
  166. proofs_dir: test/cbmc/proofs