checks.yml 3.8 KB

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