checks.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. ---
  2. name: Checks
  3. on:
  4. push:
  5. branches:
  6. - master
  7. pull_request: null
  8. env:
  9. DISABLE_TELEMETRY: 1
  10. concurrency:
  11. group: checks-${{ github.ref }}
  12. cancel-in-progress: true
  13. jobs:
  14. file-check: # Check what files changed if we’re being run in a PR or on a push.
  15. name: Check Modified Files
  16. runs-on: ubuntu-latest
  17. outputs:
  18. run: ${{ steps.check-run.outputs.run }}
  19. steps:
  20. - name: Checkout
  21. id: checkout
  22. uses: actions/checkout@v4
  23. with:
  24. fetch-depth: 0
  25. submodules: recursive
  26. - name: Check source files
  27. id: check-source-files
  28. uses: tj-actions/changed-files@v45
  29. with:
  30. since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
  31. files: |
  32. **/*.c
  33. **/*.cc
  34. **/*.h
  35. **/*.hh
  36. **/*.in
  37. **/*.patch
  38. src/aclk/aclk-schemas/
  39. src/ml/dlib/
  40. src/fluent-bit/
  41. src/web/server/h2o/libh2o/
  42. files_ignore: |
  43. netdata.spec.in
  44. **/*.md
  45. - name: Check build files
  46. id: check-build-files
  47. uses: tj-actions/changed-files@v45
  48. with:
  49. since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
  50. files: |
  51. **/*.cmake
  52. CMakeLists.txt
  53. .gitignore
  54. .github/data/distros.yml
  55. .github/workflows/build.yml
  56. packaging/cmake/
  57. packaging/*.version
  58. packaging/*.checksums
  59. files_ignore: |
  60. **/*.md
  61. packaging/repoconfig/
  62. - name: List all changed files in pattern
  63. continue-on-error: true
  64. env:
  65. CHANGED_SOURCE_FILES: ${{ steps.check-source-files.outputs.all_changed_files }}
  66. CHANGED_BUILD_FILES: ${{ steps.check-build-files.outputs.all_changed_files }}
  67. run: |
  68. for file in ${CHANGED_SOURCE_FILES} ${CHANGED_BUILD_FILES} ; do
  69. echo "$file was changed"
  70. done
  71. - name: Check Run
  72. id: check-run
  73. run: |
  74. if [ "${{ steps.check-source-files.outputs.any_modified }}" == "true" ] || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
  75. echo 'run=true' >> "${GITHUB_OUTPUT}"
  76. else
  77. echo 'run=false' >> "${GITHUB_OUTPUT}"
  78. fi
  79. libressl-checks:
  80. name: LibreSSL
  81. needs:
  82. - file-check
  83. runs-on: ubuntu-latest
  84. steps:
  85. - name: Skip Check
  86. id: skip
  87. if: needs.file-check.outputs.run != 'true'
  88. run: echo "SKIPPED"
  89. - name: Checkout
  90. if: needs.file-check.outputs.run == 'true'
  91. uses: actions/checkout@v4
  92. with:
  93. submodules: recursive
  94. - name: Build
  95. if: needs.file-check.outputs.run == 'true'
  96. run: >
  97. docker run -v "$PWD":/netdata -w /netdata alpine:latest /bin/sh -c
  98. 'apk add bash;
  99. ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata;
  100. apk del openssl openssl-dev;
  101. apk add libressl libressl-dev protobuf-dev;
  102. ./netdata-installer.sh --disable-telemetry --dont-start-it --dont-wait --one-time-build --disable-go;'
  103. clang-checks:
  104. name: Clang
  105. needs:
  106. - file-check
  107. runs-on: ubuntu-latest
  108. steps:
  109. - name: Skip Check
  110. id: skip
  111. if: needs.file-check.outputs.run != 'true'
  112. run: echo "SKIPPED"
  113. - name: Checkout
  114. if: needs.file-check.outputs.run == 'true'
  115. uses: actions/checkout@v4
  116. with:
  117. submodules: recursive
  118. - name: Build
  119. if: needs.file-check.outputs.run == 'true'
  120. run: docker build -f .github/dockerfiles/Dockerfile.clang .