| 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@v6 |
| 23 | with: |
| 24 | fetch-depth: 0 |
| 25 | submodules: recursive |
| 26 | - name: Check source files |
| 27 | id: check-source-files |
| 28 | uses: step-security/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 | files_ignore: | |
| 41 | netdata.spec.in |
| 42 | src/go/otel-collector/release-config.yaml.in |
| 43 | **/*.md |
| 44 | - name: Check build files |
| 45 | id: check-build-files |
| 46 | uses: step-security/changed-files@v45 |
| 47 | with: |
| 48 | since_last_remote_commit: ${{ github.event_name != 'pull_request' }} |
| 49 | files: | |
| 50 | **/*.cmake |
| 51 | CMakeLists.txt |
| 52 | .gitignore |
| 53 | .github/data/distros.yml |
| 54 | .github/workflows/build.yml |
| 55 | packaging/cmake/ |
| 56 | packaging/*.version |
| 57 | packaging/*.checksums |
| 58 | files_ignore: | |
| 59 | **/*.md |
| 60 | packaging/repoconfig/ |
| 61 | - name: List all changed files in pattern |
| 62 | continue-on-error: true |
| 63 | env: |
| 64 | CHANGED_SOURCE_FILES: ${{ steps.check-source-files.outputs.all_changed_files }} |
| 65 | CHANGED_BUILD_FILES: ${{ steps.check-build-files.outputs.all_changed_files }} |
| 66 | run: | |
| 67 | for file in ${CHANGED_SOURCE_FILES} ${CHANGED_BUILD_FILES} ; do |
| 68 | echo "$file was changed" |
| 69 | done |
| 70 | - name: Check Run |
| 71 | id: check-run |
| 72 | run: | |
| 73 | if [ "${{ steps.check-source-files.outputs.any_modified }}" == "true" ] || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then |
| 74 | echo 'run=true' >> "${GITHUB_OUTPUT}" |
| 75 | else |
| 76 | echo 'run=false' >> "${GITHUB_OUTPUT}" |
| 77 | fi |
| 78 | |
| 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@v6 |
| 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 | |
| 104 | clang-checks: |
| 105 | name: Clang |
| 106 | needs: |
| 107 | - file-check |
| 108 | runs-on: ubuntu-latest |
| 109 | steps: |
| 110 | - name: Skip Check |
| 111 | id: skip |
| 112 | if: needs.file-check.outputs.run != 'true' |
| 113 | run: echo "SKIPPED" |
| 114 | - name: Checkout |
| 115 | if: needs.file-check.outputs.run == 'true' |
| 116 | uses: actions/checkout@v6 |
| 117 | with: |
| 118 | submodules: recursive |
| 119 | - name: Build |
| 120 | if: needs.file-check.outputs.run == 'true' |
| 121 | run: docker build -f .github/dockerfiles/Dockerfile.clang . |