@cryptotaxi247 / netdata-1 / commits / 6e87c6a34

Remove tj-actions/changed-files from CI jobs. (#19870)

The action has been compromised and thus should not be used.

Austin S. Hemmelgarn committed Mar 15, 2025 at 15:50 UTC 6e87c6a348238c1074cb3d43080eb04ec1bd0650
5 files changed +23 -514
.github/workflows/build.yml
+12 -188
@@ -20,127 +20,30 @@ concurrency: # This keeps multiple instances of the job from running concurrentl
20 group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
21 cancel-in-progress: true
22 jobs:
23 - file-check: # Check what files changed if we’re being run in a PR or on a push.
24 - name: Check Modified Files
25 - runs-on: ubuntu-latest
26 - outputs:
27 - run: ${{ steps.check-run.outputs.run }}
28 - skip-go: ${{ steps.check-go.outputs.skip-go }}
29 - steps:
30 - - name: Checkout
31 - id: checkout
32 - uses: actions/checkout@v4
33 - with:
34 - fetch-depth: 0
35 - submodules: recursive
36 - - name: Check source files
37 - id: check-source-files
38 - uses: tj-actions/changed-files@v45
39 - with:
40 - since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
41 - files: |
42 - **/*.c
43 - **/*.cc
44 - **/*.h
45 - **/*.hh
46 - **/*.in
47 - **/*.patch
48 - src/aclk/aclk-schemas/
49 - src/ml/dlib/
50 - src/fluent-bit/
51 - src/web/server/h2o/libh2o/
52 - files_ignore: |
53 - netdata.spec.in
54 - **/*.md
55 - - name: Check build files
56 - id: check-build-files
57 - uses: tj-actions/changed-files@v45
58 - with:
59 - since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
60 - files: |
61 - **/*.cmake
62 - CMakeLists.txt
63 - netdata-installer.sh
64 - .github/data/distros.yml
65 - .github/workflows/build.yml
66 - .github/scripts/build-static.sh
67 - .github/scripts/get-static-cache-key.sh
68 - .github/scripts/gen-matrix-static.py
69 - .github/scripts/gen-matrix-build.py
70 - .github/scripts/run-updater-check.sh
71 - packaging/cmake/
72 - packaging/makeself/
73 - packaging/installer/
74 - packaging/windows/
75 - packaging/*.sh
76 - packaging/*.version
77 - packaging/*.checksums
78 - files_ignore: |
79 - **/*.md
80 - packaging/repoconfig/
81 - - name: List all changed files in pattern
82 - continue-on-error: true
83 - if: github.event_name != 'workflow_dispatch'
84 - env:
85 - CHANGED_SOURCE_FILES: ${{ steps.check-source-files.outputs.all_changed_files }}
86 - CHANGED_BUILD_FILES: ${{ steps.check-build-files.outputs.all_changed_files }}
87 - run: |
88 - for file in ${CHANGED_SOURCE_FILES} ${CHANGED_BUILD_FILES} ; do
89 - echo "$file was changed"
90 - done
91 - - name: Check Run
92 - id: check-run
93 - run: |
94 - if [ "${{ steps.check-source-files.outputs.any_modified }}" == "true" ] || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
95 - echo 'run=true' >> "${GITHUB_OUTPUT}"
96 - else
97 - echo 'run=false' >> "${GITHUB_OUTPUT}"
98 - fi
99 - - name: Check Go
100 - id: check-go
101 - run: |
102 - if [ '${{ github.event_name }}' == 'pull_request' ]; then
103 - if echo "${{ steps.check-source-files.outputs.other_changed_files }}" | grep -q '.*/(.*\.go|go\.mod|go\.sum)$' || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ]; then
104 - echo 'skip-go=' >> "${GITHUB_OUTPUT}"
105 - else
106 - echo 'skip-go=--disable-go' >> "${GITHUB_OUTPUT}"
107 - fi
108 - else
109 - echo 'skip-go=' >> "${GITHUB_OUTPUT}"
110 - fi
111 -
23 build-dist: # Build the distribution tarball and store it as an artifact.
24 name: Build Distribution Tarball
25 runs-on: ubuntu-latest
115 - needs:
116 - - file-check
26 outputs:
27 distfile: ${{ steps.build.outputs.distfile }}
28 steps:
120 - - name: Skip Check
121 - id: skip
122 - if: needs.file-check.outputs.run != 'true'
123 - run: echo "SKIPPED"
29 - name: Checkout
30 id: checkout
126 - if: needs.file-check.outputs.run == 'true'
31 uses: actions/checkout@v4
32 with:
33 fetch-depth: 0
34 submodules: recursive
35 - name: Fix tags
36 id: fix-tags
133 - if: github.event_name != 'push' && needs.file-check.outputs.run == 'true'
37 + if: github.event_name != 'push'
38 run: |
39 git fetch --tags --force
40 - name: Mark Stable
41 id: channel
138 - if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' && needs.file-check.outputs.run == 'true'
42 + if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly'
43 run: |
44 sed -i 's/^RELEASE_CHANNEL="nightly"/RELEASE_CHANNEL="stable"/' netdata-installer.sh
45 - name: Build
46 id: build
143 - if: needs.file-check.outputs.run == 'true'
47 run: |
48 mkdir -p artifacts/
49 tar --create --file "artifacts/netdata-$(git describe).tar.gz" \
@@ -151,7 +54,6 @@ jobs:
54 echo "distfile=$(find . -name 'netdata-*.tar.gz')" >> "${GITHUB_OUTPUT}"
55 - name: Store
56 id: store
154 - if: needs.file-check.outputs.run == 'true'
57 uses: actions/upload-artifact@v4.6.1
58 with:
59 name: dist-tarball
@@ -179,7 +81,6 @@ jobs:
81 && startsWith(github.ref, 'refs/heads/master')
82 && github.event_name != 'pull_request'
83 && github.repository == 'netdata/netdata'
182 - && needs.file-check.outputs.run == 'true'
84 }}
85
86 static-matrix: # Generate the static build matrix.
@@ -227,40 +128,34 @@ jobs:
128 build-static: # Build the static binary archives, and store them as artifacts.
129 name: Build Static
130 needs:
230 - - file-check
131 - static-matrix
132 strategy:
133 fail-fast: false
134 matrix: ${{ fromJson(needs.static-matrix.outputs.matrix) }}
135 runs-on: ${{ matrix.runner }}
136 steps:
237 - - name: Skip Check
238 - id: skip
239 - if: needs.file-check.outputs.run != 'true'
240 - run: echo "SKIPPED"
137 - name: Checkout
138 id: checkout
243 - if: needs.file-check.outputs.run == 'true'
139 uses: actions/checkout@v4
140 with:
141 fetch-depth: 0
142 submodules: recursive
143 - name: Fix tags
144 id: fix-tags
250 - if: github.event_name != 'push' && needs.file-check.outputs.run == 'true'
145 + if: github.event_name != 'push'
146 run: |
147 git fetch --tags --force
148 - name: Mark Stable
149 id: channel
255 - if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' && needs.file-check.outputs.run == 'true'
150 + if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly'
151 run: |
152 sed -i 's/^RELEASE_CHANNEL="nightly"/RELEASE_CHANNEL="stable"/' netdata-installer.sh packaging/makeself/install-or-update.sh
153 - name: Get Cache Key
259 - if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache')) && needs.file-check.outputs.run == 'true'
154 + if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache'))
155 id: cache-key
156 run: .github/scripts/get-static-cache-key.sh ${{ matrix.arch }} "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache') }}"
157 - name: Cache
263 - if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache')) && needs.file-check.outputs.run == 'true'
158 + if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache'))
159 id: cache
160 uses: actions/cache@v4
161 with:
@@ -268,31 +163,28 @@ jobs:
163 key: ${{ steps.cache-key.outputs.key }}
164 - name: Set up QEMU
165 id: qemu
271 - if: matrix.qemu && needs.file-check.outputs.run == 'true'
166 + if: matrix.qemu
167 run: |
168 sudo apt-get update
169 sudo apt-get upgrade -y
170 sudo apt-get install -y qemu-user-static
171 - name: Build
277 - if: github.event_name != 'workflow_dispatch' && needs.file-check.outputs.run == 'true' # Don’t use retries on PRs.
172 + if: github.event_name != 'workflow_dispatch' # Don’t use retries on PRs.
173 run: |
279 - export EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }}
174 [ "${{ matrix.qemu }}" == "true" ] || export SKIP_EMULATION=1
175 .github/scripts/build-static.sh ${{ matrix.arch }}
176 - name: Build
283 - if: github.event_name == 'workflow_dispatch' && needs.file-check.outputs.run == 'true'
177 + if: github.event_name == 'workflow_dispatch'
178 id: build
179 uses: nick-fields/retry@v3
180 with:
181 timeout_minutes: 360
182 max_attempts: 3
183 command: |
290 - export EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }}
184 [ "${{ matrix.qemu }}" == "true" ] || export SKIP_EMULATION=1
185 .github/scripts/build-static.sh ${{ matrix.arch }}
186 - name: Store
187 id: store
295 - if: needs.file-check.outputs.run == 'true'
188 uses: actions/upload-artifact@v4.6.1
189 with:
190 name: dist-static-${{ matrix.arch }}
@@ -321,45 +213,34 @@ jobs:
213 && startsWith(github.ref, 'refs/heads/master')
214 && github.event_name != 'pull_request'
215 && github.repository == 'netdata/netdata'
324 - && needs.file-check.outputs.run == 'true'
216 }}
217
218 windows-build: # Test building on Windows
219 name: Test building on Windows
220 runs-on: windows-latest
330 - needs:
331 - - file-check
221 steps:
333 - - name: Skip Check
334 - id: skip
335 - if: needs.file-check.outputs.run != 'true'
336 - run: Write-Output "SKIPPED"
222 - name: Checkout
223 uses: actions/checkout@v4
224 id: checkout
340 - if: needs.file-check.outputs.run == 'true'
225 with:
226 submodules: recursive
227 lfs: true
228 - name: Set Up Go
229 id: golang
346 - if: needs.file-check.outputs.run == 'true'
230 uses: actions/setup-go@v5
231 with:
232 go-version: "^1.23"
233 - name: Set Up Dependencies
234 id: deps
352 - if: needs.file-check.outputs.run == 'true'
235 run: ./packaging/windows/install-dependencies.ps1
236 - name: Build Netdata
237 id: build
356 - if: needs.file-check.outputs.run == 'true'
238 env:
239 BUILD_DIR: ${{ github.workspace }}\build
240 run: ./packaging/windows/build.ps1
241 - name: Sign Agent Code
242 id: sign-agent
362 - if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
243 + if: github.event_name != 'pull_request'
244 uses: azure/trusted-signing-action@v0.5.1
245 with:
246 azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
@@ -376,13 +257,12 @@ jobs:
257 timestamp-digest: SHA256
258 - name: Package Netdata
259 id: package
379 - if: needs.file-check.outputs.run == 'true'
260 env:
261 BUILD_DIR: ${{ github.workspace }}\build
262 run: ./packaging/windows/package.ps1
263 - name: Sign Installer
264 id: sign-installer
385 - if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
265 + if: github.event_name != 'pull_request'
266 uses: azure/trusted-signing-action@v0.5.1
267 with:
268 azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
@@ -427,7 +307,6 @@ jobs:
307 && startsWith(github.ref, 'refs/heads/master')
308 && github.event_name != 'pull_request'
309 && github.repository == 'netdata/netdata'
430 - && needs.file-check.outputs.run == 'true'
310 }}
311
312 prepare-upload: # Consolidate the artifacts for uploading or releasing.
@@ -437,23 +316,15 @@ jobs:
316 - build-dist
317 - build-static
318 - windows-build
440 - - file-check
319 steps:
442 - - name: Skip Check
443 - id: skip
444 - if: needs.file-check.outputs.run != 'true'
445 - run: echo "SKIPPED"
320 - name: Checkout
321 id: checkout
448 - if: needs.file-check.outputs.run == 'true'
322 uses: actions/checkout@v4
323 - name: Prepare Environment
324 id: prepare
452 - if: needs.file-check.outputs.run == 'true'
325 run: mkdir -p artifacts
326 - name: Retrieve Build Artifacts
327 id: fetch-dist
456 - if: needs.file-check.outputs.run == 'true'
328 uses: Wandalen/wretry.action@v3
329 with:
330 action: actions/download-artifact@v4
@@ -465,7 +336,6 @@ jobs:
336 attempt_delay: 2000
337 - name: Retrieve Windows Artifacts
338 id: fetch-windows
468 - if: needs.file-check.outputs.run == 'true'
339 uses: Wandalen/wretry.action@v3
340 with:
341 action: actions/download-artifact@v4
@@ -477,7 +347,6 @@ jobs:
347 attempt_delay: 2000
348 - name: Prepare Artifacts
349 id: consolidate
480 - if: needs.file-check.outputs.run == 'true'
350 working-directory: ./artifacts/
351 run: |
352 mv ../dist-artifacts/* . || exit 1
@@ -487,7 +356,6 @@ jobs:
356 cat sha256sums.txt
357 - name: Store Artifacts
358 id: store
490 - if: needs.file-check.outputs.run == 'true'
359 uses: actions/upload-artifact@v4.6.1
360 with:
361 name: final-artifacts
@@ -516,7 +384,6 @@ jobs:
384 && startsWith(github.ref, 'refs/heads/master')
385 && github.event_name != 'pull_request'
386 && github.repository == 'netdata/netdata'
519 - && needs.file-check.outputs.run == 'true'
387 }}
388
389 artifact-verification-dist: # Verify the regular installer works with the consolidated artifacts.
@@ -524,7 +391,6 @@ jobs:
391 runs-on: ubuntu-latest
392 needs:
393 - prepare-upload
527 - - file-check
394 services:
395 apache: # This gets used to serve the dist tarball for the updater script.
396 image: httpd:2.4
@@ -533,17 +399,11 @@ jobs:
399 volumes:
400 - ${{ github.workspace }}:/usr/local/apache2/htdocs/
401 steps:
536 - - name: Skip Check
537 - id: skip
538 - if: needs.file-check.outputs.run != 'true'
539 - run: echo "SKIPPED"
402 - name: Checkout
403 id: checkout
542 - if: needs.file-check.outputs.run == 'true'
404 uses: actions/checkout@v4
405 - name: Fetch artifacts
406 id: fetch
546 - if: needs.file-check.outputs.run == 'true'
407 uses: Wandalen/wretry.action@v3
408 with:
409 action: actions/download-artifact@v4
@@ -554,14 +414,12 @@ jobs:
414 attempt_delay: 2000
415 - name: Prepare artifacts directory
416 id: prepare
557 - if: needs.file-check.outputs.run == 'true'
417 run: |
418 mkdir -p download/latest
419 mv artifacts/* download/latest
420 ls -al download/latest
421 - name: Verify that artifacts work with installer
422 id: verify
564 - if: needs.file-check.outputs.run == 'true'
423 env:
424 NETDATA_TARBALL_BASEURL: http://localhost:8080/
425 run: sh -x packaging/installer/kickstart.sh --build-only --dont-start-it --disable-telemetry --dont-wait
@@ -585,7 +443,6 @@ jobs:
443 && startsWith(github.ref, 'refs/heads/master')
444 && github.event_name != 'pull_request'
445 && github.repository == 'netdata/netdata'
588 - && needs.file-check.outputs.run == 'true'
446 }}
447
448 artifact-verification-static: # Verify the static installer works with the consolidated artifacts.
@@ -593,7 +450,6 @@ jobs:
450 runs-on: ubuntu-latest
451 needs:
452 - prepare-upload
596 - - file-check
453 services:
454 apache: # This gets used to serve the static archives.
455 image: httpd:2.4
@@ -602,17 +458,11 @@ jobs:
458 volumes:
459 - ${{ github.workspace }}:/usr/local/apache2/htdocs/
460 steps:
605 - - name: Skip Check
606 - id: skip
607 - if: needs.file-check.outputs.run != 'true'
608 - run: echo "SKIPPED"
461 - name: Checkout
462 id: checkout
611 - if: needs.file-check.outputs.run == 'true'
463 uses: actions/checkout@v4
464 - name: Fetch artifacts
465 id: fetch-artifacts
615 - if: needs.file-check.outputs.run == 'true'
466 uses: Wandalen/wretry.action@v3
467 with:
468 action: actions/download-artifact@v4
@@ -623,14 +473,12 @@ jobs:
473 attempt_delay: 2000
474 - name: Prepare artifacts directory
475 id: prepare
626 - if: needs.file-check.outputs.run == 'true'
476 run: |
477 mkdir -p download/latest
478 mv artifacts/* download/latest
479 ls -al download/latest
480 - name: Verify that artifacts work with installer
481 id: verify
633 - if: needs.file-check.outputs.run == 'true'
482 env:
483 NETDATA_TARBALL_BASEURL: http://localhost:8080/
484 run: sh -x packaging/installer/kickstart.sh --static-only --dont-start-it --disable-telemetry
@@ -654,7 +502,6 @@ jobs:
502 && startsWith(github.ref, 'refs/heads/master')
503 && github.event_name != 'pull_request'
504 && github.repository == 'netdata/netdata'
657 - && needs.file-check.outputs.run == 'true'
505 }}
506
507 artifact-verification-updater: # Test the generated dist archive using the updater code.
@@ -662,7 +509,6 @@ jobs:
509 runs-on: ubuntu-latest
510 needs:
511 - prepare-upload
665 - - file-check
512 services:
513 apache: # This gets used to serve the dist tarball for the updater script.
514 image: httpd:2.4
@@ -673,15 +519,12 @@ jobs:
519 steps:
520 - name: Skip Check
521 id: skip
676 - if: needs.file-check.outputs.run != 'true'
522 run: echo "SKIPPED"
523 - name: Checkout
524 id: checkout
680 - if: needs.file-check.outputs.run == 'true'
525 uses: actions/checkout@v4
526 - name: Fetch artifacts
527 id: fetch-artifacts
684 - if: needs.file-check.outputs.run == 'true'
528 uses: Wandalen/wretry.action@v3
529 with:
530 action: actions/download-artifact@v4
@@ -692,14 +535,12 @@ jobs:
535 attempt_delay: 2000
536 - name: Prepare artifacts directory
537 id: prepare
695 - if: needs.file-check.outputs.run == 'true'
538 run: |
539 mkdir -p download/latest
540 mv artifacts/* download/latest
541 ls -al download/latest
542 - name: Run Updater Check
543 id: check
702 - if: needs.file-check.outputs.run == 'true'
544 run: |
545 docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --network host \
546 -v $PWD:/netdata -w /netdata \
@@ -725,7 +566,6 @@ jobs:
566 && startsWith(github.ref, 'refs/heads/master')
567 && github.event_name != 'pull_request'
568 && github.repository == 'netdata/netdata'
728 - && needs.file-check.outputs.run == 'true'
569 }}
570
571 create-nightly: # Create a nightly build release in netdata/netdata-nightlies
@@ -980,7 +820,6 @@ jobs:
820 if: github.event_name != 'workflow_dispatch'
821 needs:
822 - src-matrix
983 - - file-check
823 strategy:
824 fail-fast: false
825 max-parallel: 8
@@ -988,11 +827,9 @@ jobs:
827 steps:
828 - name: Skip Check
829 id: skip
991 - if: needs.file-check.outputs.run != 'true'
830 run: echo "SKIPPED"
831 - name: Checkout
832 id: checkout
995 - if: needs.file-check.outputs.run == 'true'
833 uses: actions/checkout@v4
834 with:
835 submodules: recursive
@@ -1017,10 +854,9 @@ jobs:
854 attempt_delay: 15000
855 - name: netdata-installer on ${{ matrix.distro }}
856 id: build-cloud
1020 - if: needs.file-check.outputs.run == 'true'
857 run: |
858 docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
1023 - /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --one-time-build ${{ needs.file-check.outputs.skip-go }}'
859 + /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --one-time-build'
860 - name: Failure Notification
861 uses: rtCamp/action-slack-notify@v2
862 env:
@@ -1042,15 +878,12 @@ jobs:
878 && startsWith(github.ref, 'refs/heads/master')
879 && github.event_name != 'pull_request'
880 && github.repository == 'netdata/netdata'
1045 - && needs.file-check.outputs.run == 'true'
881 }}
882
883 macos-build: # Test building on macOS
884 name: Test building on macOS
885 runs-on: ${{ matrix.runner }}
886 if: github.event_name != 'workflow_dispatch'
1052 - needs:
1053 - - file-check
887 strategy:
888 fail-fast: false
889 max-parallel: 8
@@ -1063,33 +896,24 @@ jobs:
896 - name: macos-15-M1
897 runner: macos-15
898 steps:
1066 - - name: Skip Check
1067 - id: skip
1068 - if: needs.file-check.outputs.run != 'true'
1069 - run: echo "SKIPPED"
899 - uses: actions/checkout@v4
900 id: checkout
1072 - if: needs.file-check.outputs.run == 'true'
901 with:
902 submodules: recursive
903 - name: Install latest bash
904 id: install-bash
1077 - if: needs.file-check.outputs.run == 'true'
905 run: |
906 brew install bash
907 - name: Install netdata dependencies
908 id: install-nd-dep
1082 - if: needs.file-check.outputs.run == 'true'
909 run: |
910 bash ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata-all
911 - name: Build from source
912 id: build-source
1087 - if: needs.file-check.outputs.run == 'true'
913 run: |
914 sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --one-time-build
915 - name: Test Agent start up
916 id: test-agent
1092 - if: needs.file-check.outputs.run == 'true'
917 run: |
918 /usr/local/netdata/usr/sbin/netdata -D > ./netdata.log 2>&1 &
919 ./packaging/runtime-check.sh
.github/workflows/checks.yml
-82
@@ -11,89 +11,15 @@ 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 -
14 libressl-checks:
15 name: LibreSSL
82 - needs:
83 - - file-check
16 runs-on: ubuntu-latest
17 steps:
86 - - name: Skip Check
87 - id: skip
88 - if: needs.file-check.outputs.run != 'true'
89 - run: echo "SKIPPED"
18 - name: Checkout
91 - if: needs.file-check.outputs.run == 'true'
19 uses: actions/checkout@v4
20 with:
21 submodules: recursive
22 - name: Build
96 - if: needs.file-check.outputs.run == 'true'
23 run: >
24 docker run -v "$PWD":/netdata -w /netdata alpine:latest /bin/sh -c
25 'apk add bash;
@@ -104,19 +30,11 @@ jobs:
30
31 clang-checks:
32 name: Clang
107 - needs:
108 - - file-check
33 runs-on: ubuntu-latest
34 steps:
111 - - name: Skip Check
112 - id: skip
113 - if: needs.file-check.outputs.run != 'true'
114 - run: echo "SKIPPED"
35 - name: Checkout
116 - if: needs.file-check.outputs.run == 'true'
36 uses: actions/checkout@v4
37 with:
38 submodules: recursive
39 - name: Build
121 - if: needs.file-check.outputs.run == 'true'
40 run: docker build -f .github/dockerfiles/Dockerfile.clang .
.github/workflows/docker.yml
+5 -107
@@ -26,98 +26,6 @@ concurrency:
26 group: docker-${{ github.ref }}-${{ github.event_name }}
27 cancel-in-progress: true
28 jobs:
29 - file-check: # Check what files changed if we’re being run in a PR or on a push.
30 - name: Check Modified Files
31 - runs-on: ubuntu-latest
32 - outputs:
33 - run: ${{ steps.check-run.outputs.run }}
34 - skip-go: ${{ steps.check-go.outputs.skip-go }}
35 - steps:
36 - - name: Checkout
37 - id: checkout
38 - if: github.event_name != 'workflow_dispatch'
39 - uses: actions/checkout@v4
40 - with:
41 - fetch-depth: 0
42 - submodules: recursive
43 - - name: Check source files
44 - id: check-source-files
45 - if: github.event_name != 'workflow_dispatch'
46 - uses: tj-actions/changed-files@v45
47 - with:
48 - since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
49 - files: |
50 - **/*.c
51 - **/*.cc
52 - **/*.h
53 - **/*.hh
54 - **/*.in
55 - **/*.patch
56 - src/aclk/aclk-schemas/
57 - src/ml/dlib/
58 - src/fluent-bit/
59 - src/web/server/h2o/libh2o/
60 - files_ignore: |
61 - netdata.spec.in
62 - **/*.md
63 - - name: Check build system files
64 - id: check-build-files
65 - if: github.event_name != 'workflow_dispatch'
66 - uses: tj-actions/changed-files@v45
67 - with:
68 - since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
69 - files: |
70 - .dockerignore
71 - CMakeLists.txt
72 - netdata-installer.sh
73 - .github/data/distros.yml
74 - .github/workflows/docker.yml
75 - .github/scripts/docker-test.sh
76 - .github/scripts/gen-matrix-docker.py
77 - .github/scripts/gen-docker-tags.py
78 - .github/scripts/gen-docker-imagetool-args.py
79 - packaging/cmake/
80 - packaging/docker/
81 - packaging/installer/
82 - packaging/runtime-check.sh
83 - packaging/*.version
84 - packaging/*.checksums
85 - files_ignore: |
86 - **/*.md
87 - packaging/repoconfig/
88 - - name: List all changed files in pattern
89 - continue-on-error: true
90 - if: github.event_name != 'workflow_dispatch'
91 - env:
92 - CHANGED_SOURCE_FILES: ${{ steps.check-source-files.outputs.all_changed_files }}
93 - CHANGED_BUILD_FILES: ${{ steps.check-build-files.outputs.all_changed_files }}
94 - run: |
95 - for file in ${CHANGED_SOURCE_FILES} ${CHANGED_BUILD_FILES} ; do
96 - echo "$file was changed"
97 - done
98 - - name: Check Run
99 - id: check-run
100 - run: |
101 - if [ "${{ steps.check-source-files.outputs.any_modified }}" == "true" ] || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
102 - echo 'run=true' >> "${GITHUB_OUTPUT}"
103 - else
104 - echo 'run=false' >> "${GITHUB_OUTPUT}"
105 - fi
106 - - name: Check Go
107 - id: check-go
108 - env:
109 - OTHER_CHANGED_FILES: ${{ steps.check-source-files.outputs.other_changed_files }}
110 - run: |
111 - if [ '${{ github.event_name }}' == 'pull_request' ]; then
112 - if echo "${OTHER_CHANGED_FILES}" | grep -q '.*/(.*\.go|go\.mod|go\.sum)$' || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ]; then
113 - echo 'skip-go=' >> "${GITHUB_OUTPUT}"
114 - else
115 - echo 'skip-go=--disable-go' >> "${GITHUB_OUTPUT}"
116 - fi
117 - else
118 - echo 'skip-go=' >> "${GITHUB_OUTPUT}"
119 - fi
120 -
29 matrix:
30 name: Generate Docker Build Matrix
31 runs-on: ubuntu-latest
@@ -163,7 +71,6 @@ jobs:
71 build-images:
72 name: Build Docker Images
73 needs:
166 - - file-check
74 - matrix
75 runs-on: ${{ matrix.runner }}
76 strategy:
@@ -171,39 +78,32 @@ jobs:
78 # Fail fast on releases, but run everything to completion on other triggers.
79 fail-fast: false
80 steps:
174 - - name: Skip Check
175 - id: skip
176 - if: needs.file-check.outputs.run != 'true'
177 - run: echo "SKIPPED"
81 - name: Checkout
82 id: checkout
180 - if: needs.file-check.outputs.run == 'true'
83 uses: actions/checkout@v4
84 with:
85 fetch-depth: 0
86 submodules: recursive
87 - name: Generate Artifact Name
88 id: artifact-name
187 - if: github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true' && github.event_name == 'workflow_dispatch'
89 + if: github.repository == 'netdata/netdata' && github.event_name == 'workflow_dispatch'
90 run: echo "platform=$(echo ${{ matrix.platform }} | tr '/' '-' | cut -f 2- -d '-')" >> "${GITHUB_OUTPUT}"
91 - name: Mark image as official
92 id: env
191 - if: github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true' && github.event_name == 'workflow_dispatch'
93 + if: github.repository == 'netdata/netdata' && github.event_name == 'workflow_dispatch'
94 run: echo "OFFICIAL_IMAGE=true" >> "${GITHUB_ENV}"
95 - name: Setup QEMU
96 id: qemu
195 - if: matrix.qemu && needs.file-check.outputs.run == 'true'
97 + if: matrix.qemu
98 run: |
99 sudo apt-get update
100 sudo apt-get upgrade -y
101 sudo apt-get install -y qemu-user-static
102 - name: Setup Buildx
103 id: prepare
202 - if: needs.file-check.outputs.run == 'true'
104 uses: docker/setup-buildx-action@v3
105 - name: Build Image
106 id: build
206 - if: needs.file-check.outputs.run == 'true'
107 uses: docker/build-push-action@v6
108 with:
109 platforms: ${{ matrix.platform }}
@@ -212,16 +112,15 @@ jobs:
112 cache-to: type=local,dest=/tmp/build-cache,mode=max
113 build-args: |
114 OFFICIAL_IMAGE=${{ env.OFFICIAL_IMAGE }}
215 - EXTRA_INSTALL_OPTS=${{ needs.file-check.outputs.skip-go }}
115 BUILD_VERSION=test
116 BUILD_DATE=${{ github.event.repository.updated_at }}
117 - name: Test Image
118 id: test
220 - if: needs.file-check.outputs.run == 'true' && matrix.platform == 'linux/amd64'
119 + if: matrix.platform == 'linux/amd64'
120 run: .github/scripts/docker-test.sh
121 - name: Upload Cache
122 id: upload-cache
224 - if: github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true' && github.event_name == 'workflow_dispatch'
123 + if: github.repository == 'netdata/netdata' && github.event_name == 'workflow_dispatch'
124 uses: actions/upload-artifact@v4.6.1
125 with:
126 name: cache-${{ steps.artifact-name.outputs.platform }}
@@ -251,7 +150,6 @@ jobs:
150 failure()
151 && github.event_name != 'pull_request'
152 && github.repository == 'netdata/netdata'
254 - && needs.file-check.outputs.run == 'true'
153 }}
154
155 gen-tags:
.github/workflows/go-tests.yml
-61
@@ -10,50 +10,6 @@ concurrency: # This keeps multiple instances of the job from running concurrentl
10 group: go-test-${{ github.ref }}-${{ github.event_name }}
11 cancel-in-progress: true
12 jobs:
13 - file-check: # Check what files changed if we’re being run in a PR or on a push.
14 - name: Check Modified Files
15 - runs-on: ubuntu-latest
16 - outputs:
17 - run: ${{ steps.check-run.outputs.run }}
18 - steps:
19 - - name: Checkout
20 - id: checkout
21 - uses: actions/checkout@v4
22 - with:
23 - fetch-depth: 0
24 - submodules: recursive
25 - - name: Check files
26 - id: check-files
27 - uses: tj-actions/changed-files@v45
28 - with:
29 - since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
30 - files: |
31 - **/*.cmake
32 - CMakeLists.txt
33 - .github/workflows/go-tests.yml
34 - packaging/cmake/
35 - src/go/**
36 - files_ignore: |
37 - **/*.md
38 - src/go/**/metadata.yaml
39 - packaging/repoconfig/
40 - - name: List all changed files in pattern
41 - continue-on-error: true
42 - env:
43 - ALL_CHANGED_FILES: ${{ steps.check-files.outputs.all_changed_files }}
44 - run: |
45 - for file in ${ALL_CHANGED_FILES}; do
46 - echo "$file was changed"
47 - done
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 -
13 matrix:
14 name: Generate Build Matrix
15 runs-on: ubuntu-latest
@@ -74,54 +30,42 @@ jobs:
30 name: Go toolchain tests
31 runs-on: ubuntu-latest
32 needs:
77 - - file-check
33 - matrix
34 strategy:
35 fail-fast: false
36 matrix:
37 include: ${{ fromJson(needs.matrix.outputs.matrix) }}
38 steps:
84 - - name: Skip Check
85 - id: skip
86 - if: needs.file-check.outputs.run != 'true'
87 - run: echo "SKIPPED"
39 - name: Install Go
40 uses: actions/setup-go@v5
41 with:
42 go-version: ${{ matrix.version }}
43 - name: Checkout
93 - if: needs.file-check.outputs.run == 'true'
44 uses: actions/checkout@v4
45 with:
46 submodules: recursive
47 - name: Go mod download
98 - if: needs.file-check.outputs.run == 'true'
48 run: go mod download
49 working-directory: ${{ matrix.module }}
50 - name: Compile
102 - if: needs.file-check.outputs.run == 'true'
51 run: |
52 CGO_ENABLED=0 go build -o /tmp/go-test-build ${{ matrix.build_target }}
53 /tmp/go-test-build --help || true
54 working-directory: ${{ matrix.module }}
55 - name: Go fmt
108 - if: needs.file-check.outputs.run == 'true'
56 run: |
57 go fmt ./... | tee modified-files
58 [ "$(wc -l modified-files | cut -f 1 -d ' ')" -eq 0 ] || exit 1
59 working-directory: ${{ matrix.module }}
60 - name: Go vet
114 - if: needs.file-check.outputs.run == 'true'
61 run: go vet ./...
62 working-directory: ${{ matrix.module }}
63 - name: Set up gotestfmt
118 - if: needs.file-check.outputs.run == 'true'
64 uses: GoTestTools/gotestfmt-action@v2
65 with:
66 token: ${{ secrets.GITHUB_TOKEN }}
67 version: v2.0.0
68 - name: Go test
124 - if: needs.file-check.outputs.run == 'true'
69 run: |
70 set -euo pipefail
71 go test -json ./... -race -count=1 2>&1 | gotestfmt -hide all
@@ -131,7 +75,6 @@ jobs:
75 name: Go build tests
76 runs-on: ubuntu-latest
77 needs:
134 - - file-check
78 - matrix
79 strategy:
80 fail-fast: false
@@ -147,14 +90,12 @@ jobs:
90 steps:
91 - name: Skip Check
92 id: skip
150 - if: needs.file-check.outputs.run != 'true'
93 run: echo "SKIPPED"
94 - name: Install Go
95 uses: actions/setup-go@v5
96 with:
97 go-version: ${{ matrix.version }}
98 - name: Checkout
157 - if: needs.file-check.outputs.run == 'true'
99 uses: actions/checkout@v4
100 with:
101 submodules: recursive
@@ -163,11 +104,9 @@ jobs:
104 echo "GOOS=$(echo "${{ matrix.platform }}" | cut -f 1 -d '/')" >> "${GITHUB_ENV}"
105 echo "GOARCH=$(echo "${{ matrix.platform }}" | cut -f 2 -d '/')" >> "${GITHUB_ENV}"
106 - name: Go mod download
166 - if: needs.file-check.outputs.run == 'true'
107 run: go mod download
108 working-directory: ${{ matrix.module }}
109 - name: Compile
170 - if: needs.file-check.outputs.run == 'true'
110 run: |
111 CGO_ENABLED=0 go build -o /tmp/go-test-build ${{ matrix.build_target }}
112 working-directory: ${{ matrix.module }}
.github/workflows/packaging.yml
+6 -76
@@ -27,65 +27,6 @@ concurrency:
27 group: packages-${{ github.ref }}-${{ github.event_name }}
28 cancel-in-progress: true
29 jobs:
30 - file-check: # Check what files changed if we’re being run in a PR or on a push.
31 - name: Check Modified Files
32 - runs-on: ubuntu-latest
33 - outputs:
34 - run: ${{ steps.check-run.outputs.run }}
35 - steps:
36 - - name: Checkout
37 - id: checkout
38 - uses: actions/checkout@v4
39 - with:
40 - fetch-depth: 0
41 - submodules: recursive
42 - - name: Check files
43 - id: check-files
44 - uses: tj-actions/changed-files@v45
45 - with:
46 - since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
47 - files: |
48 - **/*.c
49 - **/*.cc
50 - **/*.h
51 - **/*.hh
52 - **/*.in
53 - **/*.patch
54 - **/*.cmake
55 - netdata.spec.in
56 - CMakeLists.txt
57 - .github/data/distros.yml
58 - .github/workflows/packaging.yml
59 - .github/scripts/gen-matrix-packaging.py
60 - .github/scripts/pkg-test.sh
61 - packaging/cmake/
62 - packaging/*.sh
63 - packaging/*.version
64 - packaging/*.checksums
65 - src/aclk/aclk-schemas/
66 - src/ml/dlib/
67 - src/fluent-bit/
68 - src/web/server/h2o/libh2o/
69 - files_ignore: |
70 - **/*.md
71 - packaging/repoconfig/
72 - - name: List all changed files in pattern
73 - continue-on-error: true
74 - env:
75 - ALL_CHANGED_FILES: ${{ steps.check-files.outputs.all_changed_files }}
76 - run: |
77 - for file in ${ALL_CHANGED_FILES}; do
78 - echo "$file was changed"
79 - done
80 - - name: Check Run
81 - id: check-run
82 - run: |
83 - if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
84 - echo 'run=true' >> "${GITHUB_OUTPUT}"
85 - else
86 - echo 'run=false' >> "${GITHUB_OUTPUT}"
87 - fi
88 -
30 matrix:
31 name: Prepare Build Matrix
32 runs-on: ubuntu-latest
@@ -196,7 +137,6 @@ jobs:
137 needs:
138 - matrix
139 - version-check
199 - - file-check
140 strategy:
141 matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
142 # We intentiaonally disable the fail-fast behavior so that a
@@ -205,13 +145,8 @@ jobs:
145 fail-fast: false
146 max-parallel: 8
147 steps:
208 - - name: Skip Check
209 - id: skip
210 - if: needs.file-check.outputs.run != 'true'
211 - run: echo "SKIPPED"
148 - name: Checkout
149 id: checkout
214 - if: needs.file-check.outputs.run == 'true'
150 uses: actions/checkout@v4
151 with:
152 fetch-depth: 0 # We need full history for versioning
@@ -230,14 +165,13 @@ jobs:
165 fi
166 - name: Setup QEMU
167 id: qemu
233 - if: matrix.qemu && needs.file-check.outputs.run == 'true'
168 + if: matrix.qemu
169 run: |
170 sudo apt-get update
171 sudo apt-get upgrade -y
172 sudo apt-get install -y qemu-user-static
173 - name: Fetch images
174 id: fetch-images
240 - if: needs.file-check.outputs.run == 'true'
175 uses: nick-invision/retry@v3
176 with:
177 max_attempts: 3
@@ -248,7 +182,6 @@ jobs:
182 docker pull --platform ${{ matrix.platform }} netdata/package-builders:${{ matrix.distro }}${{ matrix.version }}-${{ matrix.builder_rev }}
183 - name: Build Packages
184 id: build
251 - if: needs.file-check.outputs.run == 'true'
185 shell: bash
186 run: |
187 docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 -e VERSION=${{ needs.version-check.outputs.version }} \
@@ -259,7 +192,6 @@ jobs:
192 --platform=${{ matrix.platform }} -v "$PWD":/netdata netdata/package-builders:${{ matrix.distro }}${{ matrix.version }}-${{ matrix.builder_rev }}
193 - name: Save Packages
194 id: artifacts
262 - if: needs.file-check.outputs.run == 'true'
195 continue-on-error: true
196 uses: actions/upload-artifact@v4.6.1
197 with:
@@ -267,7 +199,6 @@ jobs:
199 path: ${{ github.workspace }}/artifacts/*
200 - name: Test Packages
201 id: test
270 - if: needs.file-check.outputs.run == 'true'
202 shell: bash
203 run: |
204 docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 -e DISTRO=${{ matrix.distro }} \
@@ -276,18 +207,18 @@ jobs:
207 /netdata/.github/scripts/pkg-test.sh
208 - name: Import GPG Keys
209 id: import-keys
279 - if: needs.file-check.outputs.run == 'true' && matrix.format == 'deb' && github.event_name != 'pull_request'
210 + if: matrix.format == 'deb' && github.event_name != 'pull_request'
211 uses: crazy-max/ghaction-import-gpg@v6
212 with:
213 gpg_private_key: ${{ secrets.NETDATABOT_PACKAGE_SIGNING_KEY }}
214 - name: Sign DEB Packages
215 id: sign-deb
285 - if: needs.file-check.outputs.run == 'true' && matrix.format == 'deb' && github.event_name != 'pull_request'
216 + if: matrix.format == 'deb' && github.event_name != 'pull_request'
217 shell: bash
218 run: .github/scripts/deb-sign.sh artifacts ${{ steps.import-keys.outputs.fingerprint }}
219 - name: SSH setup
220 id: ssh-setup
290 - if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
221 + if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata'
222 uses: shimataro/ssh-key-action@v2
223 with:
224 key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
@@ -296,7 +227,7 @@ jobs:
227 - name: Upload to packages.netdata.cloud
228 id: package-upload
229 continue-on-error: true
299 - if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
230 + if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata'
231 run: |
232 .github/scripts/package-upload.sh \
233 packages.netdata.cloud \
@@ -306,7 +237,7 @@ jobs:
237 ${{ needs.version-check.outputs.repo }}
238 - name: Upload to packages2.netdata.cloud
239 id: package2-upload
309 - if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && needs.file-check.outputs.run == 'true'
240 + if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata'
241 run: |
242 .github/scripts/package-upload.sh \
243 packages2.netdata.cloud \
@@ -340,5 +271,4 @@ jobs:
271 && github.event_name != 'pull_request'
272 && startsWith(github.ref, 'refs/heads/master')
273 && github.repository == 'netdata/netdata'
343 - && needs.file-check.outputs.run == 'true'
274 }}