summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com>2024-03-13 15:33:25 +0200
committerGitHub <noreply@github.com>2024-03-13 15:33:25 +0200
commit8fb2d8bcfea3c6aafda0a89fac71d56dc4d518fd (patch)
treedad9bdbf2a58a0f67cfe415cd068858208e1d51d
parent97506bf3840ad6d0f928aab956bc617f0f58fa39 (diff)
Add macos check (build from source) (#17139)
* MacOS build from source and test Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Setup notification Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Apply code review Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * new line char Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> --------- Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud>
-rw-r--r--.github/workflows/build-macos.yml142
1 files changed, 142 insertions, 0 deletions
diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml
new file mode 100644
index 0000000000..d5253b248f
--- /dev/null
+++ b/.github/workflows/build-macos.yml
@@ -0,0 +1,142 @@
+---
+# CI code for build and test on macOS
+name: macOS Build and test
+on:
+ push: # Master branch checks only validate the build and generate artifacts for testing.
+ branches:
+ - master
+ pull_request: null # PR checks only validate the build and generate artifacts for testing.
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+
+jobs:
+ file-check: # Check what files changed if we’re being run in a PR or on a push.
+ name: Check Modified Files
+ runs-on: ubuntu-latest
+ outputs:
+ run: ${{ steps.check-run.outputs.run }}
+ steps:
+ - name: Checkout
+ id: checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ submodules: recursive
+ - name: Check files
+ id: check-files
+ uses: tj-actions/changed-files@v42
+ with:
+ since_last_remote_commit: ${{ github.event_name != 'pull_request' }}
+ files: |
+ **/*.c
+ **/*.cc
+ **/*.h
+ **/*.hh
+ **/*.in
+ **/*.patch
+ **/*.cmake
+ CMakeLists.txt
+ netdata-installer.sh
+ .github/workflows/build-macos.yml
+ .github/scripts/run-updater-check.sh
+ packaging/cmake/
+ packaging/installer/
+ packaging/*.sh
+ packaging/*.version
+ packaging/*.checksums
+ src/aclk/aclk-schemas/
+ src/ml/dlib/
+ src/fluent-bit/
+ src/web/server/h2o/libh2o/
+ files_ignore: |
+ netdata.spec.in
+ **/*.md
+ - name: List all changed files in pattern
+ continue-on-error: true
+ env:
+ ALL_CHANGED_FILES: ${{ steps.check-files.outputs.all_changed_files }}
+ run: |
+ for file in ${ALL_CHANGED_FILES}; do
+ echo "$file was changed"
+ done
+ - name: Check Run
+ id: check-run
+ run: |
+ if [ "${{ steps.check-files.outputs.any_modified }}" == "true" ] || [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
+ echo 'run=true' >> "${GITHUB_OUTPUT}"
+ else
+ echo 'run=false' >> "${GITHUB_OUTPUT}"
+ fi
+
+ build-test:
+ env:
+ DISABLE_TELEMETRY: 1
+ runs-on: ${{ matrix.runner }}
+ needs:
+ - file-check
+ strategy:
+ fail-fast: false
+ max-parallel: 3
+ matrix:
+ include:
+ - name: macos-12
+ runner: macos-12
+ - name: macos-13
+ runner: macos-13
+ - name: macos-14-M1
+ runner: macos-14
+ steps:
+ - name: Skip Check
+ id: skip
+ if: needs.file-check.outputs.run != 'true'
+ run: echo "SKIPPED"
+ - uses: actions/checkout@v4
+ id: checkout
+ if: needs.file-check.outputs.run == 'true'
+ with:
+ submodules: recursive
+ - name: Install latest bash
+ id: install-bash
+ if: needs.file-check.outputs.run == 'true'
+ run: |
+ brew install bash
+ - name: Install netdata dependencies
+ id: install-nd-dep
+ if: needs.file-check.outputs.run == 'true'
+ run: |
+ bash ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata
+ - name: Build from source
+ id: build-source
+ if: needs.file-check.outputs.run == 'true'
+ run: |
+ sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --require-cloud --one-time-build
+ - name: Test Agent start up
+ id: test-agent
+ if: needs.file-check.outputs.run == 'true'
+ run: |
+ /usr/local/netdata/usr/sbin/netdata -D > ./netdata.log 2>&1 &
+ ./packaging/runtime-check.sh
+ - name: Failure Notification
+ uses: rtCamp/action-slack-notify@v2
+ env:
+ SLACK_COLOR: 'danger'
+ SLACK_FOOTER: ''
+ SLACK_ICON_EMOJI: ':github-actions:'
+ SLACK_TITLE: 'Build & test from source macOS failed:'
+ SLACK_USERNAME: 'GitHub Actions'
+ SLACK_MESSAGE: |-
+ ${{ github.repository }}: macOS Build and test.
+ Checkout: ${{ steps.checkout.outcome }}
+ Setup runner: ${{ steps.install-bash.outcome }}
+ Install netdata required packages: ${{ steps.install-nd-dep.outcome }}
+ Build from source: ${{ steps.build-source.outcome }}
+ Test Agent runtime: ${{ steps.test-agent.outcome }}
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
+ if: >-
+ ${{
+ failure()
+ && startsWith(github.ref, 'refs/heads/master')
+ && github.event_name != 'pull_request'
+ && github.repository == 'netdata/netdata'
+ }}