checks.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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@v41
  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. CMakeLists.txt
  38. .gitignore
  39. .github/workflows/checks.yml
  40. build/**
  41. aclk/aclk-schemas/
  42. ml/dlib/
  43. mqtt_websockets
  44. web/server/h2o/libh2o
  45. files_ignore: |
  46. netdata.spec.in
  47. **.md
  48. - name: Check Run
  49. id: check-run
  50. run: |
  51. if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
  52. echo 'run=true' >> "${GITHUB_OUTPUT}"
  53. else
  54. echo 'run=false' >> "${GITHUB_OUTPUT}"
  55. fi
  56. libressl-checks:
  57. name: LibreSSL
  58. needs:
  59. - file-check
  60. runs-on: ubuntu-latest
  61. steps:
  62. - name: Skip Check
  63. id: skip
  64. if: needs.file-check.outputs.run != 'true'
  65. run: echo "SKIPPED"
  66. - name: Checkout
  67. if: needs.file-check.outputs.run == 'true'
  68. uses: actions/checkout@v4
  69. with:
  70. submodules: recursive
  71. - name: Build
  72. if: needs.file-check.outputs.run == 'true'
  73. run: >
  74. docker run -v "$PWD":/netdata -w /netdata alpine:latest /bin/sh -c
  75. 'apk add bash;
  76. ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata;
  77. apk del openssl openssl-dev;
  78. apk add libressl libressl-dev protobuf-dev;
  79. ./netdata-installer.sh --disable-telemetry --dont-start-it --dont-wait --one-time-build;'
  80. clang-checks:
  81. name: Clang
  82. needs:
  83. - file-check
  84. runs-on: ubuntu-latest
  85. steps:
  86. - name: Skip Check
  87. id: skip
  88. if: needs.file-check.outputs.run != 'true'
  89. run: echo "SKIPPED"
  90. - name: Checkout
  91. if: needs.file-check.outputs.run == 'true'
  92. uses: actions/checkout@v4
  93. with:
  94. submodules: recursive
  95. - name: Build
  96. if: needs.file-check.outputs.run == 'true'
  97. run: docker build -f .github/dockerfiles/Dockerfile.clang .
  98. gitignore-check:
  99. name: .gitignore
  100. needs:
  101. - file-check
  102. runs-on: ubuntu-latest
  103. steps:
  104. - name: Skip Check
  105. id: skip
  106. if: needs.file-check.outputs.run != 'true'
  107. run: echo "SKIPPED"
  108. - name: Checkout
  109. if: needs.file-check.outputs.run == 'true'
  110. uses: actions/checkout@v4
  111. with:
  112. submodules: recursive
  113. - name: Prepare environment
  114. if: needs.file-check.outputs.run == 'true'
  115. run: ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata
  116. - name: Build netdata
  117. if: needs.file-check.outputs.run == 'true'
  118. run: ./netdata-installer.sh --dont-start-it --disable-telemetry --dont-wait --install-prefix /tmp/install --one-time-build
  119. - name: Check that repo is clean
  120. if: needs.file-check.outputs.run == 'true'
  121. run: |
  122. git status --porcelain=v1 > /tmp/porcelain
  123. if [ -s /tmp/porcelain ]; then
  124. cat /tmp/porcelain
  125. exit 1
  126. fi