checks.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 files
  27. id: check-files
  28. uses: tj-actions/changed-files@v43
  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. **/*.cmake
  39. CMakeLists.txt
  40. .gitignore
  41. .github/data/distros.yml
  42. .github/workflows/build.yml
  43. .github/scripts/build-static.sh
  44. .github/scripts/get-static-cache-key.sh
  45. .github/scripts/gen-matrix-build.py
  46. .github/scripts/run-updater-check.sh
  47. packaging/cmake/
  48. packaging/*.version
  49. packaging/*.checksums
  50. src/aclk/aclk-schemas/
  51. src/ml/dlib/
  52. src/fluent-bit/
  53. src/web/server/h2o/libh2o/
  54. files_ignore: |
  55. netdata.spec.in
  56. **/*.md
  57. - name: List all changed files in pattern
  58. continue-on-error: true
  59. env:
  60. ALL_CHANGED_FILES: ${{ steps.check-files.outputs.all_changed_files }}
  61. run: |
  62. for file in ${ALL_CHANGED_FILES}; do
  63. echo "$file was changed"
  64. done
  65. - name: Check Run
  66. id: check-run
  67. run: |
  68. if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
  69. echo 'run=true' >> "${GITHUB_OUTPUT}"
  70. else
  71. echo 'run=false' >> "${GITHUB_OUTPUT}"
  72. fi
  73. libressl-checks:
  74. name: LibreSSL
  75. needs:
  76. - file-check
  77. runs-on: ubuntu-latest
  78. steps:
  79. - name: Skip Check
  80. id: skip
  81. if: needs.file-check.outputs.run != 'true'
  82. run: echo "SKIPPED"
  83. - name: Checkout
  84. if: needs.file-check.outputs.run == 'true'
  85. uses: actions/checkout@v4
  86. with:
  87. submodules: recursive
  88. - name: Build
  89. if: needs.file-check.outputs.run == 'true'
  90. run: >
  91. docker run -v "$PWD":/netdata -w /netdata alpine:latest /bin/sh -c
  92. 'apk add bash;
  93. ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata;
  94. apk del openssl openssl-dev;
  95. apk add libressl libressl-dev protobuf-dev;
  96. ./netdata-installer.sh --disable-telemetry --dont-start-it --dont-wait --one-time-build;'
  97. clang-checks:
  98. name: Clang
  99. needs:
  100. - file-check
  101. runs-on: ubuntu-latest
  102. steps:
  103. - name: Skip Check
  104. id: skip
  105. if: needs.file-check.outputs.run != 'true'
  106. run: echo "SKIPPED"
  107. - name: Checkout
  108. if: needs.file-check.outputs.run == 'true'
  109. uses: actions/checkout@v4
  110. with:
  111. submodules: recursive
  112. - name: Build
  113. if: needs.file-check.outputs.run == 'true'
  114. run: docker build -f .github/dockerfiles/Dockerfile.clang .
  115. gitignore-check:
  116. name: .gitignore
  117. needs:
  118. - file-check
  119. runs-on: ubuntu-latest
  120. steps:
  121. - name: Skip Check
  122. id: skip
  123. if: needs.file-check.outputs.run != 'true'
  124. run: echo "SKIPPED"
  125. - name: Checkout
  126. if: needs.file-check.outputs.run == 'true'
  127. uses: actions/checkout@v4
  128. with:
  129. submodules: recursive
  130. - name: Prepare environment
  131. if: needs.file-check.outputs.run == 'true'
  132. run: ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata
  133. - name: Build netdata
  134. if: needs.file-check.outputs.run == 'true'
  135. run: ./netdata-installer.sh --dont-start-it --disable-telemetry --dont-wait --install-prefix /tmp/install --one-time-build
  136. - name: Check that repo is clean
  137. if: needs.file-check.outputs.run == 'true'
  138. run: |
  139. git status --porcelain=v1 > /tmp/porcelain
  140. if [ -s /tmp/porcelain ]; then
  141. cat /tmp/porcelain
  142. exit 1
  143. fi