@cryptotaxi247 / netdata-1 / commits / 6e139dfb6

Tidy-up build related CI jobs. (#17962)

- Merge macOS build checks into the regular build workflow. - Move gitignore check to the regular build workflow, since it needs the same file checking.

Austin S. Hemmelgarn committed Jun 25, 2024 at 11:31 UTC 6e139dfb6b4372a33a276d5f2862e115b387da56
3 files changed +519 -604
.github/workflows/build-macos.yml deleted
-143
@@ -1,143 +0,0 @@
1 ----
2 -# CI code for build and test on macOS
3 -name: macOS Build and test
4 -on:
5 - push: # Master branch checks only validate the build and generate artifacts for testing.
6 - branches:
7 - - master
8 - pull_request: null # PR checks only validate the build and generate artifacts for testing.
9 -
10 -concurrency:
11 - group: ${{ github.workflow }}-${{ github.ref }}
12 -
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@v44
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 - netdata-installer.sh
41 - .github/workflows/build-macos.yml
42 - .github/scripts/run-updater-check.sh
43 - packaging/cmake/
44 - packaging/installer/
45 - packaging/*.sh
46 - packaging/*.version
47 - packaging/*.checksums
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 - packaging/repoconfig/
56 - - name: List all changed files in pattern
57 - continue-on-error: true
58 - env:
59 - ALL_CHANGED_FILES: ${{ steps.check-files.outputs.all_changed_files }}
60 - run: |
61 - for file in ${ALL_CHANGED_FILES}; do
62 - echo "$file was changed"
63 - done
64 - - name: Check Run
65 - id: check-run
66 - run: |
67 - if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
68 - echo 'run=true' >> "${GITHUB_OUTPUT}"
69 - else
70 - echo 'run=false' >> "${GITHUB_OUTPUT}"
71 - fi
72 -
73 - build-test:
74 - env:
75 - DISABLE_TELEMETRY: 1
76 - runs-on: ${{ matrix.runner }}
77 - needs:
78 - - file-check
79 - strategy:
80 - fail-fast: false
81 - max-parallel: 3
82 - matrix:
83 - include:
84 - - name: macos-12
85 - runner: macos-12
86 - - name: macos-13
87 - runner: macos-13
88 - - name: macos-14-M1
89 - runner: macos-14
90 - steps:
91 - - name: Skip Check
92 - id: skip
93 - if: needs.file-check.outputs.run != 'true'
94 - run: echo "SKIPPED"
95 - - uses: actions/checkout@v4
96 - id: checkout
97 - if: needs.file-check.outputs.run == 'true'
98 - with:
99 - submodules: recursive
100 - - name: Install latest bash
101 - id: install-bash
102 - if: needs.file-check.outputs.run == 'true'
103 - run: |
104 - brew install bash
105 - - name: Install netdata dependencies
106 - id: install-nd-dep
107 - if: needs.file-check.outputs.run == 'true'
108 - run: |
109 - bash ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata-all
110 - - name: Build from source
111 - id: build-source
112 - if: needs.file-check.outputs.run == 'true'
113 - run: |
114 - sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --require-cloud --one-time-build
115 - - name: Test Agent start up
116 - id: test-agent
117 - if: needs.file-check.outputs.run == 'true'
118 - run: |
119 - /usr/local/netdata/usr/sbin/netdata -D > ./netdata.log 2>&1 &
120 - ./packaging/runtime-check.sh
121 - - name: Failure Notification
122 - uses: rtCamp/action-slack-notify@v2
123 - env:
124 - SLACK_COLOR: 'danger'
125 - SLACK_FOOTER: ''
126 - SLACK_ICON_EMOJI: ':github-actions:'
127 - SLACK_TITLE: 'Build & test from source macOS failed:'
128 - SLACK_USERNAME: 'GitHub Actions'
129 - SLACK_MESSAGE: |-
130 - ${{ github.repository }}: macOS Build and test.
131 - Checkout: ${{ steps.checkout.outcome }}
132 - Setup runner: ${{ steps.install-bash.outcome }}
133 - Install netdata required packages: ${{ steps.install-nd-dep.outcome }}
134 - Build from source: ${{ steps.build-source.outcome }}
135 - Test Agent runtime: ${{ steps.test-agent.outcome }}
136 - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
137 - if: >-
138 - ${{
139 - failure()
140 - && startsWith(github.ref, 'refs/heads/master')
141 - && github.event_name != 'pull_request'
142 - && github.repository == 'netdata/netdata'
143 - }}
.github/workflows/build.yml
+519 -416
@@ -1,12 +1,12 @@
1 ---
2 -# Ci code for building release artifacts.
2 +# CI code for building release artifacts.
3 name: Build
4 on:
5 push: # Master branch checks only validate the build and generate artifacts for testing.
6 branches:
7 - master
8 pull_request: null # PR checks only validate the build and generate artifacts for testing.
9 - workflow_dispatch: # Dispatch runs build and validate, then push to the appropriate storage location.
9 + workflow_dispatch: # Dispatch runs build and does limited validation, then pushes to the appropriate storage location.
10 inputs:
11 type:
12 description: Build Type
@@ -17,7 +17,7 @@ on:
17 default: nightly
18 required: true
19 concurrency: # This keeps multiple instances of the job from running concurrently for the same ref and event type.
20 - group: build-${{ github.ref }}-${{ github.event_name }}
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.
@@ -275,124 +275,56 @@ jobs:
275 && needs.file-check.outputs.run == 'true'
276 }}
277
278 - matrix: # Generate the shared build matrix for our build tests.
279 - name: Prepare Build Matrix
280 - runs-on: ubuntu-latest
281 - if: github.event_name != 'workflow_dispatch'
282 - outputs:
283 - matrix: ${{ steps.set-matrix.outputs.matrix }}
284 - steps:
285 - - name: Checkout
286 - id: checkout
287 - uses: actions/checkout@v4
288 - - name: Prepare tools
289 - id: prepare
290 - run: |
291 - sudo apt-get update || true
292 - sudo apt-get install -y python3-ruamel.yaml
293 - - name: Read build matrix
294 - id: set-matrix
295 - run: |
296 - matrix="$(.github/scripts/gen-matrix-build.py)"
297 - echo "Generated matrix: ${matrix}"
298 - echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
299 - - name: Failure Notification
300 - uses: rtCamp/action-slack-notify@v2
301 - env:
302 - SLACK_COLOR: 'danger'
303 - SLACK_FOOTER: ''
304 - SLACK_ICON_EMOJI: ':github-actions:'
305 - SLACK_TITLE: 'Build matrix preparation failed:'
306 - SLACK_USERNAME: 'GitHub Actions'
307 - SLACK_MESSAGE: |-
308 - ${{ github.repository }}: Failed to prepare build matrix for build checks.
309 - Checkout: ${{ steps.checkout.outcome }}
310 - Prepare tools: ${{ steps.prepare.outcome }}
311 - Read build matrix: ${{ steps.set-matrix.outcome }}
312 - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
313 - if: >-
314 - ${{
315 - failure()
316 - && startsWith(github.ref, 'refs/heads/master')
317 - && github.event_name != 'pull_request'
318 - && github.repository == 'netdata/netdata'
319 - }}
320 -
321 - prepare-test-images: # Prepare the test environments for our build checks. This also checks dependency handling code for each tested environment.
322 - name: Prepare Test Environments
278 + prepare-upload: # Consolidate the artifacts for uploading or releasing.
279 + name: Prepare Artifacts
280 runs-on: ubuntu-latest
324 - if: github.event_name != 'workflow_dispatch'
281 needs:
326 - - matrix
327 - env:
328 - RETRY_DELAY: 300
329 - strategy:
330 - # Unlike the actual build tests, this completes _very_ fast (average of about 3 minutes for each job), so we
331 - # just run everything in parallel instead lof limiting job concurrency.
332 - fail-fast: false
333 - matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
282 + - build-dist
283 + - build-static
284 + - file-check
285 steps:
286 + - name: Skip Check
287 + id: skip
288 + if: needs.file-check.outputs.run != 'true'
289 + run: echo "SKIPPED"
290 - name: Checkout
291 id: checkout
292 + if: needs.file-check.outputs.run == 'true'
293 uses: actions/checkout@v4
338 - - name: Setup Buildx
339 - id: buildx
340 - uses: docker/setup-buildx-action@v3
341 - - name: Build test environment
342 - id: build1
343 - uses: docker/build-push-action@v6
344 - continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here.
345 - with:
346 - push: false
347 - load: false
348 - file: .github/dockerfiles/Dockerfile.build_test
349 - build-args: |
350 - BASE=${{ matrix.distro }}
351 - PRE=${{ matrix.env_prep }}
352 - RMJSONC=${{ matrix.jsonc_removal }}
353 - outputs: type=docker,dest=/tmp/image.tar
354 - tags: test:${{ matrix.artifact_key }}
355 - - name: Retry delay
356 - if: ${{ steps.build1.outcome == 'failure' }}
357 - run: sleep "${RETRY_DELAY}"
358 - - name: Build test environment (attempt 2)
359 - if: ${{ steps.build1.outcome == 'failure' }}
360 - id: build2
361 - uses: docker/build-push-action@v6
362 - continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here.
363 - with:
364 - push: false
365 - load: false
366 - file: .github/dockerfiles/Dockerfile.build_test
367 - build-args: |
368 - BASE=${{ matrix.distro }}
369 - PRE=${{ matrix.env_prep }}
370 - RMJSONC=${{ matrix.jsonc_removal }}
371 - outputs: type=docker,dest=/tmp/image.tar
372 - tags: test:${{ matrix.artifact_key }}
373 - - name: Retry delay
374 - if: ${{ steps.build1.outcome == 'failure' && steps.build2.outcome == 'failure' }}
375 - run: sleep "${RETRY_DELAY}"
376 - - name: Build test environment (attempt 3)
377 - if: ${{ steps.build1.outcome == 'failure' && steps.build2.outcome == 'failure' }}
378 - id: build3
379 - uses: docker/build-push-action@v6
294 + - name: Prepare Environment
295 + id: prepare
296 + if: needs.file-check.outputs.run == 'true'
297 + run: mkdir -p artifacts
298 + - name: Retrieve Build Artifacts
299 + id: fetch-dist
300 + if: needs.file-check.outputs.run == 'true'
301 + uses: Wandalen/wretry.action@v3
302 with:
381 - push: false
382 - load: false
383 - file: .github/dockerfiles/Dockerfile.build_test
384 - build-args: |
385 - BASE=${{ matrix.distro }}
386 - PRE=${{ matrix.env_prep }}
387 - RMJSONC=${{ matrix.jsonc_removal }}
388 - outputs: type=docker,dest=/tmp/image.tar
389 - tags: test:${{ matrix.artifact_key }}
390 - - name: Upload image artifact
391 - id: upload
303 + action: actions/download-artifact@v4
304 + with: |
305 + pattern: dist-*
306 + path: dist-artifacts
307 + merge-multiple: true
308 + attempt_limit: 3
309 + attempt_delay: 2000
310 + - name: Prepare Artifacts
311 + id: consolidate
312 + if: needs.file-check.outputs.run == 'true'
313 + working-directory: ./artifacts/
314 + run: |
315 + mv ../dist-artifacts/* . || exit 1
316 + ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
317 + cp ../packaging/version ./latest-version.txt || exit 1
318 + cp ../integrations/integrations.js ./integrations.js || exit 1
319 + sha256sum -b ./* > sha256sums.txt || exit 1
320 + cat sha256sums.txt
321 + - name: Store Artifacts
322 + id: store
323 + if: needs.file-check.outputs.run == 'true'
324 uses: actions/upload-artifact@v4
325 with:
394 - name: ${{ matrix.artifact_key }}-test-env
395 - path: /tmp/image.tar
326 + name: final-artifacts
327 + path: artifacts/*
328 retention-days: 30
329 - name: Failure Notification
330 uses: rtCamp/action-slack-notify@v2
@@ -400,16 +332,15 @@ jobs:
332 SLACK_COLOR: 'danger'
333 SLACK_FOOTER: ''
334 SLACK_ICON_EMOJI: ':github-actions:'
403 - SLACK_TITLE: 'Test environment preparation for ${{ matrix.distro }} failed:'
335 + SLACK_TITLE: 'Failed to prepare release artifacts for upload:'
336 SLACK_USERNAME: 'GitHub Actions'
337 SLACK_MESSAGE: |-
406 - ${{ github.repository }}: Test environment preparation for ${{ matrix.distro }} failed.
338 + ${{ github.repository }}: Failed to prepare release artifacts for upload.
339 Checkout: ${{ steps.checkout.outcome }}
408 - Set up Buildx: ${{ steps.buildx.outcome }}
409 - Build test environment: ${{ steps.build1.outcome }}
410 - Build test environment (attempt 2): ${{ steps.build2.outcome }}
411 - Build test environment (attempt 3): ${{ steps.build3.outcome }}
412 - Upload: ${{ steps.upload.outcome }}
340 + Prepare environment: ${{ steps.prepare.outcome }}
341 + Fetch dist tarball: ${{ steps.fetch-dist.outcome }}
342 + Consolidate artifacts: ${{ steps.consolidate.outcome }}
343 + Store: ${{ steps.store.outcome }}
344 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
345 if: >-
346 ${{
@@ -417,20 +348,22 @@ jobs:
348 && startsWith(github.ref, 'refs/heads/master')
349 && github.event_name != 'pull_request'
350 && github.repository == 'netdata/netdata'
351 + && needs.file-check.outputs.run == 'true'
352 }}
353
422 - source-build: # Test various source build arrangements.
423 - name: Test Source Build
354 + artifact-verification-dist: # Verify the regular installer works with the consolidated artifacts.
355 + name: Test Consolidated Artifacts (Source)
356 runs-on: ubuntu-latest
425 - if: github.event_name != 'workflow_dispatch'
357 needs:
427 - - matrix
428 - - prepare-test-images
358 + - prepare-upload
359 - file-check
430 - strategy:
431 - fail-fast: false
432 - max-parallel: 8
433 - matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
360 + services:
361 + apache: # This gets used to serve the dist tarball for the updater script.
362 + image: httpd:2.4
363 + ports:
364 + - 8080:80
365 + volumes:
366 + - ${{ github.workspace }}:/usr/local/apache2/htdocs/
367 steps:
368 - name: Skip Check
369 id: skip
@@ -440,57 +373,43 @@ jobs:
373 id: checkout
374 if: needs.file-check.outputs.run == 'true'
375 uses: actions/checkout@v4
443 - with:
444 - submodules: recursive
445 - - name: Fetch test environment
376 + - name: Fetch artifacts
377 id: fetch
378 if: needs.file-check.outputs.run == 'true'
379 uses: Wandalen/wretry.action@v3
380 with:
381 action: actions/download-artifact@v4
382 with: |
452 - name: ${{ matrix.artifact_key }}-test-env
453 - path: .
383 + name: final-artifacts
384 + path: artifacts
385 attempt_limit: 3
386 attempt_delay: 2000
456 - - name: Load test environment
457 - id: load
458 - if: needs.file-check.outputs.run == 'true'
459 - run: docker load --input image.tar
460 - - name: netdata-installer on ${{ matrix.distro }}, disable cloud
461 - id: build-no-cloud
387 + - name: Prepare artifacts directory
388 + id: prepare
389 if: needs.file-check.outputs.run == 'true'
390 run: |
464 - docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
465 - /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
466 - - name: netdata-installer on ${{ matrix.distro }}, require cloud
467 - id: build-cloud
391 + mkdir -p download/latest
392 + mv artifacts/* download/latest
393 + ls -al download/latest
394 + - name: Verify that artifacts work with installer
395 + id: verify
396 if: needs.file-check.outputs.run == 'true'
469 - run: |
470 - docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
471 - /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
472 - - name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C
473 - id: build-no-jsonc
474 - if: matrix.jsonc_removal != '' && needs.file-check.outputs.run == 'true'
475 - run: |
476 - docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
477 - /bin/sh -c '/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
397 + env:
398 + NETDATA_TARBALL_BASEURL: http://localhost:8080/
399 + run: packaging/installer/kickstart.sh --build-only --dont-start-it --disable-telemetry --dont-wait
400 - name: Failure Notification
401 uses: rtCamp/action-slack-notify@v2
402 env:
403 SLACK_COLOR: 'danger'
404 SLACK_FOOTER: ''
405 SLACK_ICON_EMOJI: ':github-actions:'
484 - SLACK_TITLE: 'Build tests for ${{ matrix.distro }} failed:'
406 + SLACK_TITLE: 'Artifact verification for source tarball failed.'
407 SLACK_USERNAME: 'GitHub Actions'
408 SLACK_MESSAGE: |-
487 - ${{ github.repository }}: Build tests for ${{ matrix.distro }} failed.
409 + ${{ github.repository }}: Artifact verification for source tarball failed.
410 Checkout: ${{ steps.checkout.outcome }}
489 - Fetch test environment: ${{ steps.fetch.outcome }}
490 - Load test environment: ${{ steps.load.outcome }}
491 - netdata-installer, disable cloud: ${{ steps.build-no-cloud.outcome }}
492 - netdata-installer, require cloud: ${{ steps.build-cloud.outcome }}
493 - netdata-installer, no JSON-C: ${{ steps.build-no-jsonc.outcome }}
411 + Fetch artifacts: ${{ steps.fetch.outcome }}
412 + Verify artifacts: ${{ steps.verify.outcome }}
413 SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
414 if: >-
415 ${{
@@ -501,21 +420,14 @@ jobs:
420 && needs.file-check.outputs.run == 'true'
421 }}
422
504 - updater-check: # Test the generated dist archive using the updater code.
505 - name: Test Generated Distfile and Updater Code
423 + artifact-verification-static: # Verify the static installer works with the consolidated artifacts.
424 + name: Test Consolidated Artifacts (Static)
425 runs-on: ubuntu-latest
507 - if: github.event_name != 'workflow_dispatch'
426 needs:
509 - - build-dist
510 - - matrix
511 - - prepare-test-images
427 + - prepare-upload
428 - file-check
513 - strategy:
514 - fail-fast: false
515 - max-parallel: 8
516 - matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
429 services:
518 - apache: # This gets used to serve the dist tarball for the updater script.
430 + apache: # This gets used to serve the static archives.
431 image: httpd:2.4
432 ports:
433 - 8080:80
@@ -530,259 +442,18 @@ jobs:
442 id: checkout
443 if: needs.file-check.outputs.run == 'true'
444 uses: actions/checkout@v4
533 - - name: Fetch dist tarball artifacts
534 - id: fetch-tarball
445 + - name: Fetch artifacts
446 + id: fetch-artifacts
447 if: needs.file-check.outputs.run == 'true'
448 uses: Wandalen/wretry.action@v3
449 with:
450 action: actions/download-artifact@v4
451 with: |
540 - name: dist-tarball
541 - path: dist-tarball
452 + name: final-artifacts
453 + path: artifacts
454 attempt_limit: 3
455 attempt_delay: 2000
544 - - name: Prepare artifact directory
545 - id: prepare
546 - if: needs.file-check.outputs.run == 'true'
547 - run: |
548 - mkdir -p artifacts/download/v9999.0.0 || exit 1
549 - mkdir -p artifacts/latest || exit 1
550 - echo "v9999.0.0" > artifacts/latest/latest-version.txt || exit 1
551 - cp dist-tarball/* artifacts/download/v9999.0.0 || exit 1
552 - cd artifacts/download/v9999.0.0 || exit 1
553 - ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
554 - ls -lFh
555 - sha256sum -b ./* > "sha256sums.txt" || exit 1
556 - cat sha256sums.txt
557 - cd ../.. || exit 1
558 - ls -lR
559 - - name: Fetch test environment
560 - id: fetch-test-environment
561 - if: needs.file-check.outputs.run == 'true'
562 - uses: Wandalen/wretry.action@v3
563 - with:
564 - action: actions/download-artifact@v4
565 - with: |
566 - name: ${{ matrix.artifact_key }}-test-env
567 - path: .
568 - attempt_limit: 3
569 - attempt_delay: 2000
570 - - name: Load test environment
571 - id: load
572 - if: needs.file-check.outputs.run == 'true'
573 - run: docker load --input image.tar
574 - - name: Install netdata and run the updater on ${{ matrix.distro }}
575 - id: updater-check
576 - if: needs.file-check.outputs.run == 'true'
577 - run: |
578 - docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --network host -w /netdata \
579 - -e EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }} \
580 - test:${{ matrix.artifact_key }} /netdata/.github/scripts/run-updater-check.sh
581 - - name: Failure Notification
582 - uses: rtCamp/action-slack-notify@v2
583 - env:
584 - SLACK_COLOR: 'danger'
585 - SLACK_FOOTER: ''
586 - SLACK_ICON_EMOJI: ':github-actions:'
587 - SLACK_TITLE: 'Updater checks for ${{ matrix.distro }} failed:'
588 - SLACK_USERNAME: 'GitHub Actions'
589 - SLACK_MESSAGE: |-
590 - ${{ github.repository }}: Updater checks for ${{ matrix.distro }} failed.
591 - Checkout: ${{ steps.checkout.outcome }}
592 - Fetch dist tarball: ${{ steps.fetch-tarball.outcome }}
593 - Prepare artifact directory: ${{ steps.prepare.outcome }}
594 - Fetch test environment: ${{ steps.fetch-test-environment.outcome }}
595 - Load test environment: ${{ steps.load.outcome }}
596 - Updater check: ${{ steps.updater-check.outcome }}
597 - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
598 - if: >-
599 - ${{
600 - failure()
601 - && startsWith(github.ref, 'refs/heads/master')
602 - && github.event_name != 'pull_request'
603 - && github.repository == 'netdata/netdata'
604 - && needs.file-check.outputs.run == 'true'
605 - }}
606 -
607 - prepare-upload: # Consolidate the artifacts for uploading or releasing.
608 - name: Prepare Artifacts
609 - runs-on: ubuntu-latest
610 - needs:
611 - - build-dist
612 - - build-static
613 - - file-check
614 - steps:
615 - - name: Skip Check
616 - id: skip
617 - if: needs.file-check.outputs.run != 'true'
618 - run: echo "SKIPPED"
619 - - name: Checkout
620 - id: checkout
621 - if: needs.file-check.outputs.run == 'true'
622 - uses: actions/checkout@v4
623 - - name: Prepare Environment
624 - id: prepare
625 - if: needs.file-check.outputs.run == 'true'
626 - run: mkdir -p artifacts
627 - - name: Retrieve Build Artifacts
628 - id: fetch-dist
629 - if: needs.file-check.outputs.run == 'true'
630 - uses: Wandalen/wretry.action@v3
631 - with:
632 - action: actions/download-artifact@v4
633 - with: |
634 - pattern: dist-*
635 - path: dist-artifacts
636 - merge-multiple: true
637 - attempt_limit: 3
638 - attempt_delay: 2000
639 - - name: Prepare Artifacts
640 - id: consolidate
641 - if: needs.file-check.outputs.run == 'true'
642 - working-directory: ./artifacts/
643 - run: |
644 - mv ../dist-artifacts/* . || exit 1
645 - ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
646 - cp ../packaging/version ./latest-version.txt || exit 1
647 - cp ../integrations/integrations.js ./integrations.js || exit 1
648 - sha256sum -b ./* > sha256sums.txt || exit 1
649 - cat sha256sums.txt
650 - - name: Store Artifacts
651 - id: store
652 - if: needs.file-check.outputs.run == 'true'
653 - uses: actions/upload-artifact@v4
654 - with:
655 - name: final-artifacts
656 - path: artifacts/*
657 - retention-days: 30
658 - - name: Failure Notification
659 - uses: rtCamp/action-slack-notify@v2
660 - env:
661 - SLACK_COLOR: 'danger'
662 - SLACK_FOOTER: ''
663 - SLACK_ICON_EMOJI: ':github-actions:'
664 - SLACK_TITLE: 'Failed to prepare release artifacts for upload:'
665 - SLACK_USERNAME: 'GitHub Actions'
666 - SLACK_MESSAGE: |-
667 - ${{ github.repository }}: Failed to prepare release artifacts for upload.
668 - Checkout: ${{ steps.checkout.outcome }}
669 - Prepare environment: ${{ steps.prepare.outcome }}
670 - Fetch dist tarball: ${{ steps.fetch-dist.outcome }}
671 - Consolidate artifacts: ${{ steps.consolidate.outcome }}
672 - Store: ${{ steps.store.outcome }}
673 - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
674 - if: >-
675 - ${{
676 - failure()
677 - && startsWith(github.ref, 'refs/heads/master')
678 - && github.event_name != 'pull_request'
679 - && github.repository == 'netdata/netdata'
680 - && needs.file-check.outputs.run == 'true'
681 - }}
682 -
683 - artifact-verification-dist: # Verify the regular installer works with the consolidated artifacts.
684 - name: Test Consolidated Artifacts (Source)
685 - runs-on: ubuntu-latest
686 - needs:
687 - - prepare-upload
688 - - file-check
689 - services:
690 - apache: # This gets used to serve the dist tarball for the updater script.
691 - image: httpd:2.4
692 - ports:
693 - - 8080:80
694 - volumes:
695 - - ${{ github.workspace }}:/usr/local/apache2/htdocs/
696 - steps:
697 - - name: Skip Check
698 - id: skip
699 - if: needs.file-check.outputs.run != 'true'
700 - run: echo "SKIPPED"
701 - - name: Checkout
702 - id: checkout
703 - if: needs.file-check.outputs.run == 'true'
704 - uses: actions/checkout@v4
705 - - name: Fetch artifacts
706 - id: fetch
707 - if: needs.file-check.outputs.run == 'true'
708 - uses: Wandalen/wretry.action@v3
709 - with:
710 - action: actions/download-artifact@v4
711 - with: |
712 - name: final-artifacts
713 - path: artifacts
714 - attempt_limit: 3
715 - attempt_delay: 2000
716 - - name: Prepare artifacts directory
717 - id: prepare
718 - if: needs.file-check.outputs.run == 'true'
719 - run: |
720 - mkdir -p download/latest
721 - mv artifacts/* download/latest
722 - ls -al download/latest
723 - - name: Verify that artifacts work with installer
724 - id: verify
725 - if: needs.file-check.outputs.run == 'true'
726 - env:
727 - NETDATA_TARBALL_BASEURL: http://localhost:8080/
728 - run: packaging/installer/kickstart.sh --build-only --dont-start-it --disable-telemetry --dont-wait
729 - - name: Failure Notification
730 - uses: rtCamp/action-slack-notify@v2
731 - env:
732 - SLACK_COLOR: 'danger'
733 - SLACK_FOOTER: ''
734 - SLACK_ICON_EMOJI: ':github-actions:'
735 - SLACK_TITLE: 'Artifact verification for source tarball failed.'
736 - SLACK_USERNAME: 'GitHub Actions'
737 - SLACK_MESSAGE: |-
738 - ${{ github.repository }}: Artifact verification for source tarball failed.
739 - Checkout: ${{ steps.checkout.outcome }}
740 - Fetch artifacts: ${{ steps.fetch.outcome }}
741 - Verify artifacts: ${{ steps.verify.outcome }}
742 - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
743 - if: >-
744 - ${{
745 - failure()
746 - && startsWith(github.ref, 'refs/heads/master')
747 - && github.event_name != 'pull_request'
748 - && github.repository == 'netdata/netdata'
749 - && needs.file-check.outputs.run == 'true'
750 - }}
751 -
752 - artifact-verification-static: # Verify the static installer works with the consolidated artifacts.
753 - name: Test Consolidated Artifacts (Static)
754 - runs-on: ubuntu-latest
755 - needs:
756 - - prepare-upload
757 - - file-check
758 - services:
759 - apache: # This gets used to serve the static archives.
760 - image: httpd:2.4
761 - ports:
762 - - 8080:80
763 - volumes:
764 - - ${{ github.workspace }}:/usr/local/apache2/htdocs/
765 - steps:
766 - - name: Skip Check
767 - id: skip
768 - if: needs.file-check.outputs.run != 'true'
769 - run: echo "SKIPPED"
770 - - name: Checkout
771 - id: checkout
772 - if: needs.file-check.outputs.run == 'true'
773 - uses: actions/checkout@v4
774 - - name: Fetch artifacts
775 - id: fetch-artifacts
776 - if: needs.file-check.outputs.run == 'true'
777 - uses: Wandalen/wretry.action@v3
778 - with:
779 - action: actions/download-artifact@v4
780 - with: |
781 - name: final-artifacts
782 - path: artifacts
783 - attempt_limit: 3
784 - attempt_delay: 2000
785 - - name: Prepare artifacts directory
456 + - name: Prepare artifacts directory
457 id: prepare
458 if: needs.file-check.outputs.run == 'true'
459 run: |
@@ -1074,3 +745,435 @@ jobs:
745 success()
746 && github.event_name == 'workflow_dispatch'
747 }}
748 +
749 + # Remaining jobs are only used for CI checks, and not as part of the release process
750 +
751 + matrix: # Generate the shared build matrix for our Linux build tests.
752 + name: Prepare Build Matrix
753 + runs-on: ubuntu-latest
754 + if: github.event_name != 'workflow_dispatch'
755 + outputs:
756 + matrix: ${{ steps.set-matrix.outputs.matrix }}
757 + steps:
758 + - name: Checkout
759 + id: checkout
760 + uses: actions/checkout@v4
761 + - name: Prepare tools
762 + id: prepare
763 + run: |
764 + sudo apt-get update || true
765 + sudo apt-get install -y python3-ruamel.yaml
766 + - name: Read build matrix
767 + id: set-matrix
768 + run: |
769 + matrix="$(.github/scripts/gen-matrix-build.py)"
770 + echo "Generated matrix: ${matrix}"
771 + echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
772 + - name: Failure Notification
773 + uses: rtCamp/action-slack-notify@v2
774 + env:
775 + SLACK_COLOR: 'danger'
776 + SLACK_FOOTER: ''
777 + SLACK_ICON_EMOJI: ':github-actions:'
778 + SLACK_TITLE: 'Build matrix preparation failed:'
779 + SLACK_USERNAME: 'GitHub Actions'
780 + SLACK_MESSAGE: |-
781 + ${{ github.repository }}: Failed to prepare build matrix for build checks.
782 + Checkout: ${{ steps.checkout.outcome }}
783 + Prepare tools: ${{ steps.prepare.outcome }}
784 + Read build matrix: ${{ steps.set-matrix.outcome }}
785 + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
786 + if: >-
787 + ${{
788 + failure()
789 + && startsWith(github.ref, 'refs/heads/master')
790 + && github.event_name != 'pull_request'
791 + && github.repository == 'netdata/netdata'
792 + }}
793 +
794 + prepare-test-images: # Prepare the test environments for our build checks. This also checks dependency handling code for each tested environment.
795 + name: Prepare Test Environments
796 + runs-on: ubuntu-latest
797 + if: github.event_name != 'workflow_dispatch'
798 + needs:
799 + - matrix
800 + env:
801 + RETRY_DELAY: 300
802 + strategy:
803 + # Unlike the actual build tests, this completes _very_ fast (average of about 3 minutes for each job), so we
804 + # just run everything in parallel instead lof limiting job concurrency.
805 + fail-fast: false
806 + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
807 + steps:
808 + - name: Checkout
809 + id: checkout
810 + uses: actions/checkout@v4
811 + - name: Setup Buildx
812 + id: buildx
813 + uses: docker/setup-buildx-action@v3
814 + - name: Build test environment
815 + id: build1
816 + uses: docker/build-push-action@v6
817 + continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here.
818 + with:
819 + push: false
820 + load: false
821 + file: .github/dockerfiles/Dockerfile.build_test
822 + build-args: |
823 + BASE=${{ matrix.distro }}
824 + PRE=${{ matrix.env_prep }}
825 + RMJSONC=${{ matrix.jsonc_removal }}
826 + outputs: type=docker,dest=/tmp/image.tar
827 + tags: test:${{ matrix.artifact_key }}
828 + - name: Retry delay
829 + if: ${{ steps.build1.outcome == 'failure' }}
830 + run: sleep "${RETRY_DELAY}"
831 + - name: Build test environment (attempt 2)
832 + if: ${{ steps.build1.outcome == 'failure' }}
833 + id: build2
834 + uses: docker/build-push-action@v6
835 + continue-on-error: true # We retry 3 times at 5 minute intervals if there is a failure here.
836 + with:
837 + push: false
838 + load: false
839 + file: .github/dockerfiles/Dockerfile.build_test
840 + build-args: |
841 + BASE=${{ matrix.distro }}
842 + PRE=${{ matrix.env_prep }}
843 + RMJSONC=${{ matrix.jsonc_removal }}
844 + outputs: type=docker,dest=/tmp/image.tar
845 + tags: test:${{ matrix.artifact_key }}
846 + - name: Retry delay
847 + if: ${{ steps.build1.outcome == 'failure' && steps.build2.outcome == 'failure' }}
848 + run: sleep "${RETRY_DELAY}"
849 + - name: Build test environment (attempt 3)
850 + if: ${{ steps.build1.outcome == 'failure' && steps.build2.outcome == 'failure' }}
851 + id: build3
852 + uses: docker/build-push-action@v6
853 + with:
854 + push: false
855 + load: false
856 + file: .github/dockerfiles/Dockerfile.build_test
857 + build-args: |
858 + BASE=${{ matrix.distro }}
859 + PRE=${{ matrix.env_prep }}
860 + RMJSONC=${{ matrix.jsonc_removal }}
861 + outputs: type=docker,dest=/tmp/image.tar
862 + tags: test:${{ matrix.artifact_key }}
863 + - name: Upload image artifact
864 + id: upload
865 + uses: actions/upload-artifact@v4
866 + with:
867 + name: ${{ matrix.artifact_key }}-test-env
868 + path: /tmp/image.tar
869 + retention-days: 30
870 + - name: Failure Notification
871 + uses: rtCamp/action-slack-notify@v2
872 + env:
873 + SLACK_COLOR: 'danger'
874 + SLACK_FOOTER: ''
875 + SLACK_ICON_EMOJI: ':github-actions:'
876 + SLACK_TITLE: 'Test environment preparation for ${{ matrix.distro }} failed:'
877 + SLACK_USERNAME: 'GitHub Actions'
878 + SLACK_MESSAGE: |-
879 + ${{ github.repository }}: Test environment preparation for ${{ matrix.distro }} failed.
880 + Checkout: ${{ steps.checkout.outcome }}
881 + Set up Buildx: ${{ steps.buildx.outcome }}
882 + Build test environment: ${{ steps.build1.outcome }}
883 + Build test environment (attempt 2): ${{ steps.build2.outcome }}
884 + Build test environment (attempt 3): ${{ steps.build3.outcome }}
885 + Upload: ${{ steps.upload.outcome }}
886 + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
887 + if: >-
888 + ${{
889 + failure()
890 + && startsWith(github.ref, 'refs/heads/master')
891 + && github.event_name != 'pull_request'
892 + && github.repository == 'netdata/netdata'
893 + }}
894 +
895 + source-build: # Test various source build arrangements.
896 + name: Test Source Build
897 + runs-on: ubuntu-latest
898 + if: github.event_name != 'workflow_dispatch'
899 + needs:
900 + - matrix
901 + - prepare-test-images
902 + - file-check
903 + strategy:
904 + fail-fast: false
905 + max-parallel: 8
906 + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
907 + steps:
908 + - name: Skip Check
909 + id: skip
910 + if: needs.file-check.outputs.run != 'true'
911 + run: echo "SKIPPED"
912 + - name: Checkout
913 + id: checkout
914 + if: needs.file-check.outputs.run == 'true'
915 + uses: actions/checkout@v4
916 + with:
917 + submodules: recursive
918 + - name: Fetch test environment
919 + id: fetch
920 + if: needs.file-check.outputs.run == 'true'
921 + uses: Wandalen/wretry.action@v3
922 + with:
923 + action: actions/download-artifact@v4
924 + with: |
925 + name: ${{ matrix.artifact_key }}-test-env
926 + path: .
927 + attempt_limit: 3
928 + attempt_delay: 2000
929 + - name: Load test environment
930 + id: load
931 + if: needs.file-check.outputs.run == 'true'
932 + run: docker load --input image.tar
933 + - name: netdata-installer on ${{ matrix.distro }}, disable cloud
934 + id: build-no-cloud
935 + if: needs.file-check.outputs.run == 'true'
936 + run: |
937 + docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
938 + /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --disable-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
939 + - name: netdata-installer on ${{ matrix.distro }}, require cloud
940 + id: build-cloud
941 + if: needs.file-check.outputs.run == 'true'
942 + run: |
943 + docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
944 + /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
945 + - name: netdata-installer on ${{ matrix.distro }}, require cloud, no JSON-C
946 + id: build-no-jsonc
947 + if: matrix.jsonc_removal != '' && needs.file-check.outputs.run == 'true'
948 + run: |
949 + docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
950 + /bin/sh -c '/rmjsonc.sh && ./netdata-installer.sh --dont-wait --dont-start-it --require-cloud --one-time-build ${{ needs.file-check.outputs.skip-go }}'
951 + - name: Failure Notification
952 + uses: rtCamp/action-slack-notify@v2
953 + env:
954 + SLACK_COLOR: 'danger'
955 + SLACK_FOOTER: ''
956 + SLACK_ICON_EMOJI: ':github-actions:'
957 + SLACK_TITLE: 'Build tests for ${{ matrix.distro }} failed:'
958 + SLACK_USERNAME: 'GitHub Actions'
959 + SLACK_MESSAGE: |-
960 + ${{ github.repository }}: Build tests for ${{ matrix.distro }} failed.
961 + Checkout: ${{ steps.checkout.outcome }}
962 + Fetch test environment: ${{ steps.fetch.outcome }}
963 + Load test environment: ${{ steps.load.outcome }}
964 + netdata-installer, disable cloud: ${{ steps.build-no-cloud.outcome }}
965 + netdata-installer, require cloud: ${{ steps.build-cloud.outcome }}
966 + netdata-installer, no JSON-C: ${{ steps.build-no-jsonc.outcome }}
967 + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
968 + if: >-
969 + ${{
970 + failure()
971 + && startsWith(github.ref, 'refs/heads/master')
972 + && github.event_name != 'pull_request'
973 + && github.repository == 'netdata/netdata'
974 + && needs.file-check.outputs.run == 'true'
975 + }}
976 +
977 + macos-build: # Test building on macOS
978 + runs-on: ${{ matrix.runner }}
979 + if: github.event_name != 'workflow_dispatch'
980 + needs:
981 + - file-check
982 + strategy:
983 + fail-fast: false
984 + max-parallel: 8
985 + matrix:
986 + include:
987 + - name: macos-12
988 + runner: macos-12
989 + - name: macos-13
990 + runner: macos-13
991 + - name: macos-14-M1
992 + runner: macos-14
993 + steps:
994 + - name: Skip Check
995 + id: skip
996 + if: needs.file-check.outputs.run != 'true'
997 + run: echo "SKIPPED"
998 + - uses: actions/checkout@v4
999 + id: checkout
1000 + if: needs.file-check.outputs.run == 'true'
1001 + with:
1002 + submodules: recursive
1003 + - name: Install latest bash
1004 + id: install-bash
1005 + if: needs.file-check.outputs.run == 'true'
1006 + run: |
1007 + brew install bash
1008 + - name: Install netdata dependencies
1009 + id: install-nd-dep
1010 + if: needs.file-check.outputs.run == 'true'
1011 + run: |
1012 + bash ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata-all
1013 + - name: Build from source
1014 + id: build-source
1015 + if: needs.file-check.outputs.run == 'true'
1016 + run: |
1017 + sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --require-cloud --one-time-build
1018 + - name: Test Agent start up
1019 + id: test-agent
1020 + if: needs.file-check.outputs.run == 'true'
1021 + run: |
1022 + /usr/local/netdata/usr/sbin/netdata -D > ./netdata.log 2>&1 &
1023 + ./packaging/runtime-check.sh
1024 + - name: Failure Notification
1025 + uses: rtCamp/action-slack-notify@v2
1026 + env:
1027 + SLACK_COLOR: 'danger'
1028 + SLACK_FOOTER: ''
1029 + SLACK_ICON_EMOJI: ':github-actions:'
1030 + SLACK_TITLE: 'Build & test from source macOS failed:'
1031 + SLACK_USERNAME: 'GitHub Actions'
1032 + SLACK_MESSAGE: |-
1033 + ${{ github.repository }}: macOS Build and test.
1034 + Checkout: ${{ steps.checkout.outcome }}
1035 + Setup runner: ${{ steps.install-bash.outcome }}
1036 + Install netdata required packages: ${{ steps.install-nd-dep.outcome }}
1037 + Build from source: ${{ steps.build-source.outcome }}
1038 + Test Agent runtime: ${{ steps.test-agent.outcome }}
1039 + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
1040 + if: >-
1041 + ${{
1042 + failure()
1043 + && startsWith(github.ref, 'refs/heads/master')
1044 + && github.event_name != 'pull_request'
1045 + && github.repository == 'netdata/netdata'
1046 + }}
1047 +
1048 + updater-check: # Test the generated dist archive using the updater code.
1049 + name: Test Generated Distfile and Updater Code
1050 + runs-on: ubuntu-latest
1051 + if: github.event_name != 'workflow_dispatch'
1052 + needs:
1053 + - build-dist
1054 + - matrix
1055 + - prepare-test-images
1056 + - file-check
1057 + strategy:
1058 + fail-fast: false
1059 + max-parallel: 8
1060 + matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
1061 + services:
1062 + apache: # This gets used to serve the dist tarball for the updater script.
1063 + image: httpd:2.4
1064 + ports:
1065 + - 8080:80
1066 + volumes:
1067 + - ${{ github.workspace }}:/usr/local/apache2/htdocs/
1068 + steps:
1069 + - name: Skip Check
1070 + id: skip
1071 + if: needs.file-check.outputs.run != 'true'
1072 + run: echo "SKIPPED"
1073 + - name: Checkout
1074 + id: checkout
1075 + if: needs.file-check.outputs.run == 'true'
1076 + uses: actions/checkout@v4
1077 + - name: Fetch dist tarball artifacts
1078 + id: fetch-tarball
1079 + if: needs.file-check.outputs.run == 'true'
1080 + uses: Wandalen/wretry.action@v3
1081 + with:
1082 + action: actions/download-artifact@v4
1083 + with: |
1084 + name: dist-tarball
1085 + path: dist-tarball
1086 + attempt_limit: 3
1087 + attempt_delay: 2000
1088 + - name: Prepare artifact directory
1089 + id: prepare
1090 + if: needs.file-check.outputs.run == 'true'
1091 + run: |
1092 + mkdir -p artifacts/download/v9999.0.0 || exit 1
1093 + mkdir -p artifacts/latest || exit 1
1094 + echo "v9999.0.0" > artifacts/latest/latest-version.txt || exit 1
1095 + cp dist-tarball/* artifacts/download/v9999.0.0 || exit 1
1096 + cd artifacts/download/v9999.0.0 || exit 1
1097 + ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
1098 + ls -lFh
1099 + sha256sum -b ./* > "sha256sums.txt" || exit 1
1100 + cat sha256sums.txt
1101 + cd ../.. || exit 1
1102 + ls -lR
1103 + - name: Fetch test environment
1104 + id: fetch-test-environment
1105 + if: needs.file-check.outputs.run == 'true'
1106 + uses: Wandalen/wretry.action@v3
1107 + with:
1108 + action: actions/download-artifact@v4
1109 + with: |
1110 + name: ${{ matrix.artifact_key }}-test-env
1111 + path: .
1112 + attempt_limit: 3
1113 + attempt_delay: 2000
1114 + - name: Load test environment
1115 + id: load
1116 + if: needs.file-check.outputs.run == 'true'
1117 + run: docker load --input image.tar
1118 + - name: Install netdata and run the updater on ${{ matrix.distro }}
1119 + id: updater-check
1120 + if: needs.file-check.outputs.run == 'true'
1121 + run: |
1122 + docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --network host -w /netdata \
1123 + -e EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }} \
1124 + test:${{ matrix.artifact_key }} /netdata/.github/scripts/run-updater-check.sh
1125 + - name: Failure Notification
1126 + uses: rtCamp/action-slack-notify@v2
1127 + env:
1128 + SLACK_COLOR: 'danger'
1129 + SLACK_FOOTER: ''
1130 + SLACK_ICON_EMOJI: ':github-actions:'
1131 + SLACK_TITLE: 'Updater checks for ${{ matrix.distro }} failed:'
1132 + SLACK_USERNAME: 'GitHub Actions'
1133 + SLACK_MESSAGE: |-
1134 + ${{ github.repository }}: Updater checks for ${{ matrix.distro }} failed.
1135 + Checkout: ${{ steps.checkout.outcome }}
1136 + Fetch dist tarball: ${{ steps.fetch-tarball.outcome }}
1137 + Prepare artifact directory: ${{ steps.prepare.outcome }}
1138 + Fetch test environment: ${{ steps.fetch-test-environment.outcome }}
1139 + Load test environment: ${{ steps.load.outcome }}
1140 + Updater check: ${{ steps.updater-check.outcome }}
1141 + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
1142 + if: >-
1143 + ${{
1144 + failure()
1145 + && startsWith(github.ref, 'refs/heads/master')
1146 + && github.event_name != 'pull_request'
1147 + && github.repository == 'netdata/netdata'
1148 + && needs.file-check.outputs.run == 'true'
1149 + }}
1150 +
1151 + gitignore-check: # Verify that the build process does not make any changes to the source tree.
1152 + name: .gitignore
1153 + needs:
1154 + - file-check
1155 + runs-on: ubuntu-latest
1156 + steps:
1157 + - name: Skip Check
1158 + id: skip
1159 + if: needs.file-check.outputs.run != 'true'
1160 + run: echo "SKIPPED"
1161 + - name: Checkout
1162 + if: needs.file-check.outputs.run == 'true'
1163 + uses: actions/checkout@v4
1164 + with:
1165 + submodules: recursive
1166 + - name: Prepare environment
1167 + if: needs.file-check.outputs.run == 'true'
1168 + run: ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata
1169 + - name: Build netdata
1170 + if: needs.file-check.outputs.run == 'true'
1171 + run: ./netdata-installer.sh --dont-start-it --disable-telemetry --dont-wait --install-prefix /tmp/install --one-time-build ${{ needs.file-check.outputs.skip-go }}
1172 + - name: Check that repo is clean
1173 + if: needs.file-check.outputs.run == 'true'
1174 + run: |
1175 + git status --porcelain=v1 > /tmp/porcelain
1176 + if [ -s /tmp/porcelain ]; then
1177 + cat /tmp/porcelain
1178 + exit 1
1179 + fi
.github/workflows/checks.yml
-45
@@ -16,7 +16,6 @@ jobs:
16 runs-on: ubuntu-latest
17 outputs:
18 run: ${{ steps.check-run.outputs.run }}
19 - skip-go: ${{ steps.check-go.outputs.skip-go }}
19 steps:
20 - name: Checkout
21 id: checkout
@@ -77,20 +76,6 @@ jobs:
76 else
77 echo 'run=false' >> "${GITHUB_OUTPUT}"
78 fi
80 - - name: Check Go
81 - id: check-go
82 - env:
83 - OTHER_CHANGED_FILES: ${{ steps.check-source-files.outputs.other_changed_files }}
84 - run: |
85 - if [ '${{ github.event_name }}' == 'pull_request' ]; then
86 - if echo "${OTHER_CHANGED_FILES}" | grep -q '.*/(.*\.go|go\.mod|go\.sum)$' || [ "${{ steps.check-build-files.outputs.any_modified }}" == "true" ]; then
87 - echo 'skip-go=' >> "${GITHUB_OUTPUT}"
88 - else
89 - echo 'skip-go=--disable-go' >> "${GITHUB_OUTPUT}"
90 - fi
91 - else
92 - echo 'skip-go=' >> "${GITHUB_OUTPUT}"
93 - fi
79
80 libressl-checks:
81 name: LibreSSL
@@ -135,33 +120,3 @@ jobs:
120 - name: Build
121 if: needs.file-check.outputs.run == 'true'
122 run: docker build -f .github/dockerfiles/Dockerfile.clang .
138 -
139 - gitignore-check:
140 - name: .gitignore
141 - needs:
142 - - file-check
143 - runs-on: ubuntu-latest
144 - steps:
145 - - name: Skip Check
146 - id: skip
147 - if: needs.file-check.outputs.run != 'true'
148 - run: echo "SKIPPED"
149 - - name: Checkout
150 - if: needs.file-check.outputs.run == 'true'
151 - uses: actions/checkout@v4
152 - with:
153 - submodules: recursive
154 - - name: Prepare environment
155 - if: needs.file-check.outputs.run == 'true'
156 - run: ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata
157 - - name: Build netdata
158 - if: needs.file-check.outputs.run == 'true'
159 - run: ./netdata-installer.sh --dont-start-it --disable-telemetry --dont-wait --install-prefix /tmp/install --one-time-build ${{ needs.file-check.outputs.skip-go }}
160 - - name: Check that repo is clean
161 - if: needs.file-check.outputs.run == 'true'
162 - run: |
163 - git status --porcelain=v1 > /tmp/porcelain
164 - if [ -s /tmp/porcelain ]; then
165 - cat /tmp/porcelain
166 - exit 1
167 - fi