build.yml 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  1. ---
  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 does limited validation, then pushes to the appropriate storage location.
  10. inputs:
  11. type:
  12. description: Build Type
  13. default: nightly
  14. required: true
  15. version:
  16. description: Version Tag
  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: ${{ 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. build-dist: # Build the distribution tarball and store it as an artifact.
  112. name: Build Distribution Tarball
  113. runs-on: ubuntu-latest
  114. needs:
  115. - file-check
  116. outputs:
  117. distfile: ${{ steps.build.outputs.distfile }}
  118. steps:
  119. - name: Skip Check
  120. id: skip
  121. if: needs.file-check.outputs.run != 'true'
  122. run: echo "SKIPPED"
  123. - name: Checkout
  124. id: checkout
  125. if: needs.file-check.outputs.run == 'true'
  126. uses: actions/checkout@v4
  127. with:
  128. fetch-depth: 0
  129. submodules: recursive
  130. - name: Fix tags
  131. id: fix-tags
  132. if: github.event_name != 'push' && needs.file-check.outputs.run == 'true'
  133. run: |
  134. git fetch --tags --force
  135. - name: Mark Stable
  136. id: channel
  137. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' && needs.file-check.outputs.run == 'true'
  138. run: |
  139. sed -i 's/^RELEASE_CHANNEL="nightly"/RELEASE_CHANNEL="stable"/' netdata-installer.sh
  140. - name: Build
  141. id: build
  142. if: needs.file-check.outputs.run == 'true'
  143. run: |
  144. mkdir -p artifacts/
  145. tar --create --file "artifacts/netdata-$(git describe).tar.gz" \
  146. --sort=name --posix --auto-compress --exclude=artifacts/ --exclude=.git \
  147. --exclude=.gitignore --exclude=.gitattributes --exclude=.gitmodules \
  148. --transform "s/^\\.\\//netdata-$(git describe)\\//" --verbose .
  149. cd artifacts/
  150. echo "distfile=$(find . -name 'netdata-*.tar.gz')" >> "${GITHUB_OUTPUT}"
  151. - name: Store
  152. id: store
  153. if: needs.file-check.outputs.run == 'true'
  154. uses: actions/upload-artifact@v4.6.0
  155. with:
  156. name: dist-tarball
  157. path: artifacts/*.tar.gz
  158. retention-days: 30
  159. - name: Failure Notification
  160. uses: rtCamp/action-slack-notify@v2
  161. env:
  162. SLACK_COLOR: 'danger'
  163. SLACK_FOOTER: ''
  164. SLACK_ICON_EMOJI: ':github-actions:'
  165. SLACK_TITLE: 'Distribution tarball creation failed:'
  166. SLACK_USERNAME: 'GitHub Actions'
  167. SLACK_MESSAGE: |-
  168. ${{ github.repository }}: Failed to create source tarball for distribution.
  169. Checkout: ${{ steps.checkout.outcome }}
  170. Fix Tags: ${{ steps.fix-tags.outcome }}
  171. Mark stable: ${{ steps.channel.outcome }}
  172. Build: ${{ steps.build.outcome }}
  173. Store: ${{ steps.store.outcome }}
  174. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  175. if: >-
  176. ${{
  177. failure()
  178. && startsWith(github.ref, 'refs/heads/master')
  179. && github.event_name != 'pull_request'
  180. && github.repository == 'netdata/netdata'
  181. && needs.file-check.outputs.run == 'true'
  182. }}
  183. static-matrix: # Generate the static build matrix.
  184. name: Prepare Build Matrix
  185. runs-on: ubuntu-latest
  186. outputs:
  187. matrix: ${{ steps.set-matrix.outputs.matrix }}
  188. steps:
  189. - name: Checkout
  190. id: checkout
  191. uses: actions/checkout@v4
  192. - name: Prepare tools
  193. id: prepare
  194. run: |
  195. sudo apt-get update || true
  196. sudo apt-get install -y python3-ruamel.yaml
  197. - name: Read build matrix
  198. id: set-matrix
  199. run: |
  200. matrix="$(.github/scripts/gen-matrix-static.py)"
  201. echo "Generated matrix: ${matrix}"
  202. echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
  203. - name: Failure Notification
  204. uses: rtCamp/action-slack-notify@v2
  205. env:
  206. SLACK_COLOR: 'danger'
  207. SLACK_FOOTER: ''
  208. SLACK_ICON_EMOJI: ':github-actions:'
  209. SLACK_TITLE: 'Static build matrix preparation failed:'
  210. SLACK_USERNAME: 'GitHub Actions'
  211. SLACK_MESSAGE: |-
  212. ${{ github.repository }}: Failed to prepare build matrix for build checks.
  213. Checkout: ${{ steps.checkout.outcome }}
  214. Prepare tools: ${{ steps.prepare.outcome }}
  215. Read build matrix: ${{ steps.set-matrix.outcome }}
  216. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  217. if: >-
  218. ${{
  219. failure()
  220. && startsWith(github.ref, 'refs/heads/master')
  221. && github.event_name != 'pull_request'
  222. && github.repository == 'netdata/netdata'
  223. }}
  224. build-static: # Build the static binary archives, and store them as artifacts.
  225. name: Build Static
  226. needs:
  227. - file-check
  228. - static-matrix
  229. strategy:
  230. fail-fast: false
  231. matrix: ${{ fromJson(needs.static-matrix.outputs.matrix) }}
  232. runs-on: ${{ matrix.runner }}
  233. steps:
  234. - name: Skip Check
  235. id: skip
  236. if: needs.file-check.outputs.run != 'true'
  237. run: echo "SKIPPED"
  238. - name: Checkout
  239. id: checkout
  240. if: needs.file-check.outputs.run == 'true'
  241. uses: actions/checkout@v4
  242. with:
  243. fetch-depth: 0
  244. submodules: recursive
  245. - name: Fix tags
  246. id: fix-tags
  247. if: github.event_name != 'push' && needs.file-check.outputs.run == 'true'
  248. run: |
  249. git fetch --tags --force
  250. - name: Mark Stable
  251. id: channel
  252. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type != 'nightly' && needs.file-check.outputs.run == 'true'
  253. run: |
  254. sed -i 's/^RELEASE_CHANNEL="nightly"/RELEASE_CHANNEL="stable"/' netdata-installer.sh packaging/makeself/install-or-update.sh
  255. - name: Get Cache Key
  256. if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache')) && needs.file-check.outputs.run == 'true'
  257. id: cache-key
  258. run: .github/scripts/get-static-cache-key.sh ${{ matrix.arch }} "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache') }}"
  259. - name: Cache
  260. if: (github.event_name != 'pull_request' || ! contains(github.event.pull_request.labels.*.name, 'run-ci/no-cache')) && needs.file-check.outputs.run == 'true'
  261. id: cache
  262. uses: actions/cache@v4
  263. with:
  264. path: artifacts/cache
  265. key: ${{ steps.cache-key.outputs.key }}
  266. - name: Set up QEMU
  267. id: qemu
  268. if: matrix.qemu && needs.file-check.outputs.run == 'true'
  269. run: |
  270. sudo apt-get update
  271. sudo apt-get upgrade -y
  272. sudo apt-get install -y qemu-user-static
  273. - name: Build
  274. if: github.event_name != 'workflow_dispatch' && needs.file-check.outputs.run == 'true' # Don’t use retries on PRs.
  275. run: |
  276. export EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }}
  277. [ "${{ matrix.qemu }}" == "true" ] || export SKIP_EMULATION=1
  278. .github/scripts/build-static.sh ${{ matrix.arch }}
  279. - name: Build
  280. if: github.event_name == 'workflow_dispatch' && needs.file-check.outputs.run == 'true'
  281. id: build
  282. uses: nick-fields/retry@v3
  283. with:
  284. timeout_minutes: 360
  285. max_attempts: 3
  286. command: |
  287. export EXTRA_INSTALL_FLAGS=${{ needs.file-check.outputs.skip-go }}
  288. [ "${{ matrix.qemu }}" == "true" ] || export SKIP_EMULATION=1
  289. .github/scripts/build-static.sh ${{ matrix.arch }}
  290. - name: Store
  291. id: store
  292. if: needs.file-check.outputs.run == 'true'
  293. uses: actions/upload-artifact@v4.6.0
  294. with:
  295. name: dist-static-${{ matrix.arch }}
  296. path: artifacts/*.gz.run
  297. retention-days: 30
  298. - name: Failure Notification
  299. uses: rtCamp/action-slack-notify@v2
  300. env:
  301. SLACK_COLOR: 'danger'
  302. SLACK_FOOTER: ''
  303. SLACK_ICON_EMOJI: ':github-actions:'
  304. SLACK_TITLE: 'Static build failed:'
  305. SLACK_USERNAME: 'GitHub Actions'
  306. SLACK_MESSAGE: |-
  307. ${{ github.repository }}: Failed to create static installer archive for ${{ matrix.arch }}.
  308. Checkout: ${{ steps.checkout.outcome }}
  309. Fix Tags: ${{ steps.fix-tags.outcome }}
  310. Mark stable: ${{ steps.channel.outcome }}
  311. Set up QEMU: ${{ steps.qemu.outcome }}
  312. Build: ${{ steps.build.outcome }}
  313. Store: ${{ steps.store.outcome }}
  314. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  315. if: >-
  316. ${{
  317. failure()
  318. && startsWith(github.ref, 'refs/heads/master')
  319. && github.event_name != 'pull_request'
  320. && github.repository == 'netdata/netdata'
  321. && needs.file-check.outputs.run == 'true'
  322. }}
  323. windows-build: # Test building on Windows
  324. name: Test building on Windows
  325. runs-on: windows-latest
  326. needs:
  327. - file-check
  328. steps:
  329. - name: Skip Check
  330. id: skip
  331. if: needs.file-check.outputs.run != 'true'
  332. run: Write-Output "SKIPPED"
  333. - name: Checkout
  334. uses: actions/checkout@v4
  335. id: checkout
  336. if: needs.file-check.outputs.run == 'true'
  337. with:
  338. submodules: recursive
  339. lfs: true
  340. - name: Set Up Go
  341. id: golang
  342. if: needs.file-check.outputs.run == 'true'
  343. uses: actions/setup-go@v5
  344. with:
  345. go-version: "^1.23"
  346. - name: Set Up Dependencies
  347. id: deps
  348. if: needs.file-check.outputs.run == 'true'
  349. run: ./packaging/windows/install-dependencies.ps1
  350. - name: Build Netdata
  351. id: build
  352. if: needs.file-check.outputs.run == 'true'
  353. env:
  354. BUILD_DIR: ${{ github.workspace }}\build
  355. run: ./packaging/windows/build.ps1
  356. - name: Sign Agent Code
  357. id: sign-agent
  358. if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
  359. uses: azure/trusted-signing-action@v0.5.1
  360. with:
  361. azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
  362. azure-client-id: ${{ secrets.CODE_SIGNING_CLIENT_ID }}
  363. azure-client-secret: ${{ secrets.CODE_SIGNING_CLIENT_SECRET }}
  364. endpoint: "https://eus.codesigning.azure.net/"
  365. trusted-signing-account-name: Netdata
  366. certificate-profile-name: Netdata
  367. files-folder: ${{ github.workspace }}\build
  368. files-folder-filter: exe,dll
  369. files-folder-recurse: true
  370. file-digest: SHA256
  371. timestamp-rfc3161: "http://timestamp.acs.microsoft.com"
  372. timestamp-digest: SHA256
  373. - name: Package Netdata
  374. id: package
  375. if: needs.file-check.outputs.run == 'true'
  376. env:
  377. BUILD_DIR: ${{ github.workspace }}\build
  378. run: ./packaging/windows/package.ps1
  379. - name: Sign Installer
  380. id: sign-installer
  381. if: needs.file-check.outputs.run == 'true' && github.event_name != 'pull_request'
  382. uses: azure/trusted-signing-action@v0.5.1
  383. with:
  384. azure-tenant-id: ${{ secrets.CODE_SIGNING_TENNANT_ID }}
  385. azure-client-id: ${{ secrets.CODE_SIGNING_CLIENT_ID }}
  386. azure-client-secret: ${{ secrets.CODE_SIGNING_CLIENT_SECRET }}
  387. endpoint: "https://eus.codesigning.azure.net/"
  388. trusted-signing-account-name: Netdata
  389. certificate-profile-name: Netdata
  390. files-folder: ${{ github.workspace }}\packaging\windows
  391. files-folder-filter: msi
  392. file-digest: SHA256
  393. timestamp-rfc3161: "http://timestamp.acs.microsoft.com"
  394. timestamp-digest: SHA256
  395. - name: Upload Installer
  396. id: upload
  397. uses: actions/upload-artifact@v4.6.0
  398. with:
  399. name: windows-x86_64-installer
  400. path: packaging\windows\netdata*.msi
  401. retention-days: 30
  402. - name: Failure Notification
  403. uses: rtCamp/action-slack-notify@v2
  404. env:
  405. SLACK_COLOR: 'danger'
  406. SLACK_FOOTER: ''
  407. SLACK_ICON_EMOJI: ':github-actions:'
  408. SLACK_TITLE: 'Windows build failed:'
  409. SLACK_USERNAME: 'GitHub Actions'
  410. SLACK_MESSAGE: |-
  411. ${{ github.repository }}: Windows build failed.
  412. Checkout: ${{ steps.checkout.outcome }}
  413. Set Up Dependencies: ${{ steps.deps.outcome }}
  414. Build Netdata: ${{ steps.build.outcome }}
  415. Sign Agent Code: ${{ steps.sign-agent.outcome }}
  416. Package Netdata: ${{ steps.package.outcome }}
  417. Sign Installer: ${{ steps.sign-installer.outcome }}
  418. Upload Installer: ${{ steps.upload.outcome }}
  419. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  420. if: >-
  421. ${{
  422. failure()
  423. && startsWith(github.ref, 'refs/heads/master')
  424. && github.event_name != 'pull_request'
  425. && github.repository == 'netdata/netdata'
  426. && needs.file-check.outputs.run == 'true'
  427. }}
  428. prepare-upload: # Consolidate the artifacts for uploading or releasing.
  429. name: Prepare Artifacts
  430. runs-on: ubuntu-latest
  431. needs:
  432. - build-dist
  433. - build-static
  434. - windows-build
  435. - file-check
  436. steps:
  437. - name: Skip Check
  438. id: skip
  439. if: needs.file-check.outputs.run != 'true'
  440. run: echo "SKIPPED"
  441. - name: Checkout
  442. id: checkout
  443. if: needs.file-check.outputs.run == 'true'
  444. uses: actions/checkout@v4
  445. - name: Prepare Environment
  446. id: prepare
  447. if: needs.file-check.outputs.run == 'true'
  448. run: mkdir -p artifacts
  449. - name: Retrieve Build Artifacts
  450. id: fetch-dist
  451. if: needs.file-check.outputs.run == 'true'
  452. uses: Wandalen/wretry.action@v3
  453. with:
  454. action: actions/download-artifact@v4
  455. with: |
  456. pattern: dist-*
  457. path: dist-artifacts
  458. merge-multiple: true
  459. attempt_limit: 3
  460. attempt_delay: 2000
  461. - name: Retrieve Windows Artifacts
  462. id: fetch-windows
  463. if: needs.file-check.outputs.run == 'true'
  464. uses: Wandalen/wretry.action@v3
  465. with:
  466. action: actions/download-artifact@v4
  467. with: |
  468. pattern: windows-*-installer
  469. path: dist-artifacts
  470. merge-multiple: true
  471. attempt_limit: 3
  472. attempt_delay: 2000
  473. - name: Prepare Artifacts
  474. id: consolidate
  475. if: needs.file-check.outputs.run == 'true'
  476. working-directory: ./artifacts/
  477. run: |
  478. mv ../dist-artifacts/* . || exit 1
  479. ln -s ${{ needs.build-dist.outputs.distfile }} netdata-latest.tar.gz || exit 1
  480. cp ../packaging/version ./latest-version.txt || exit 1
  481. sha256sum -b ./* > sha256sums.txt || exit 1
  482. cat sha256sums.txt
  483. - name: Store Artifacts
  484. id: store
  485. if: needs.file-check.outputs.run == 'true'
  486. uses: actions/upload-artifact@v4.6.0
  487. with:
  488. name: final-artifacts
  489. path: artifacts/*
  490. retention-days: 30
  491. - name: Failure Notification
  492. uses: rtCamp/action-slack-notify@v2
  493. env:
  494. SLACK_COLOR: 'danger'
  495. SLACK_FOOTER: ''
  496. SLACK_ICON_EMOJI: ':github-actions:'
  497. SLACK_TITLE: 'Failed to prepare release artifacts for upload:'
  498. SLACK_USERNAME: 'GitHub Actions'
  499. SLACK_MESSAGE: |-
  500. ${{ github.repository }}: Failed to prepare release artifacts for upload.
  501. Checkout: ${{ steps.checkout.outcome }}
  502. Prepare environment: ${{ steps.prepare.outcome }}
  503. Fetch dist artifacts: ${{ steps.fetch-dist.outcome }}
  504. Fetch Windows installers: ${{ steps.fetch-windows.outcome }}
  505. Consolidate artifacts: ${{ steps.consolidate.outcome }}
  506. Store: ${{ steps.store.outcome }}
  507. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  508. if: >-
  509. ${{
  510. failure()
  511. && startsWith(github.ref, 'refs/heads/master')
  512. && github.event_name != 'pull_request'
  513. && github.repository == 'netdata/netdata'
  514. && needs.file-check.outputs.run == 'true'
  515. }}
  516. artifact-verification-dist: # Verify the regular installer works with the consolidated artifacts.
  517. name: Test Consolidated Artifacts (Source)
  518. runs-on: ubuntu-latest
  519. needs:
  520. - prepare-upload
  521. - file-check
  522. services:
  523. apache: # This gets used to serve the dist tarball for the updater script.
  524. image: httpd:2.4
  525. ports:
  526. - 8080:80
  527. volumes:
  528. - ${{ github.workspace }}:/usr/local/apache2/htdocs/
  529. steps:
  530. - name: Skip Check
  531. id: skip
  532. if: needs.file-check.outputs.run != 'true'
  533. run: echo "SKIPPED"
  534. - name: Checkout
  535. id: checkout
  536. if: needs.file-check.outputs.run == 'true'
  537. uses: actions/checkout@v4
  538. - name: Fetch artifacts
  539. id: fetch
  540. if: needs.file-check.outputs.run == 'true'
  541. uses: Wandalen/wretry.action@v3
  542. with:
  543. action: actions/download-artifact@v4
  544. with: |
  545. name: final-artifacts
  546. path: artifacts
  547. attempt_limit: 3
  548. attempt_delay: 2000
  549. - name: Prepare artifacts directory
  550. id: prepare
  551. if: needs.file-check.outputs.run == 'true'
  552. run: |
  553. mkdir -p download/latest
  554. mv artifacts/* download/latest
  555. ls -al download/latest
  556. - name: Verify that artifacts work with installer
  557. id: verify
  558. if: needs.file-check.outputs.run == 'true'
  559. env:
  560. NETDATA_TARBALL_BASEURL: http://localhost:8080/
  561. run: sh -x packaging/installer/kickstart.sh --build-only --dont-start-it --disable-telemetry --dont-wait
  562. - name: Failure Notification
  563. uses: rtCamp/action-slack-notify@v2
  564. env:
  565. SLACK_COLOR: 'danger'
  566. SLACK_FOOTER: ''
  567. SLACK_ICON_EMOJI: ':github-actions:'
  568. SLACK_TITLE: 'Artifact verification for source tarball failed.'
  569. SLACK_USERNAME: 'GitHub Actions'
  570. SLACK_MESSAGE: |-
  571. ${{ github.repository }}: Artifact verification for source tarball failed.
  572. Checkout: ${{ steps.checkout.outcome }}
  573. Fetch artifacts: ${{ steps.fetch.outcome }}
  574. Verify artifacts: ${{ steps.verify.outcome }}
  575. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  576. if: >-
  577. ${{
  578. failure()
  579. && startsWith(github.ref, 'refs/heads/master')
  580. && github.event_name != 'pull_request'
  581. && github.repository == 'netdata/netdata'
  582. && needs.file-check.outputs.run == 'true'
  583. }}
  584. artifact-verification-static: # Verify the static installer works with the consolidated artifacts.
  585. name: Test Consolidated Artifacts (Static)
  586. runs-on: ubuntu-latest
  587. needs:
  588. - prepare-upload
  589. - file-check
  590. services:
  591. apache: # This gets used to serve the static archives.
  592. image: httpd:2.4
  593. ports:
  594. - 8080:80
  595. volumes:
  596. - ${{ github.workspace }}:/usr/local/apache2/htdocs/
  597. steps:
  598. - name: Skip Check
  599. id: skip
  600. if: needs.file-check.outputs.run != 'true'
  601. run: echo "SKIPPED"
  602. - name: Checkout
  603. id: checkout
  604. if: needs.file-check.outputs.run == 'true'
  605. uses: actions/checkout@v4
  606. - name: Fetch artifacts
  607. id: fetch-artifacts
  608. if: needs.file-check.outputs.run == 'true'
  609. uses: Wandalen/wretry.action@v3
  610. with:
  611. action: actions/download-artifact@v4
  612. with: |
  613. name: final-artifacts
  614. path: artifacts
  615. attempt_limit: 3
  616. attempt_delay: 2000
  617. - name: Prepare artifacts directory
  618. id: prepare
  619. if: needs.file-check.outputs.run == 'true'
  620. run: |
  621. mkdir -p download/latest
  622. mv artifacts/* download/latest
  623. ls -al download/latest
  624. - name: Verify that artifacts work with installer
  625. id: verify
  626. if: needs.file-check.outputs.run == 'true'
  627. env:
  628. NETDATA_TARBALL_BASEURL: http://localhost:8080/
  629. run: sh -x packaging/installer/kickstart.sh --static-only --dont-start-it --disable-telemetry
  630. - name: Failure Notification
  631. uses: rtCamp/action-slack-notify@v2
  632. env:
  633. SLACK_COLOR: 'danger'
  634. SLACK_FOOTER: ''
  635. SLACK_ICON_EMOJI: ':github-actions:'
  636. SLACK_TITLE: 'Artifact verification for static build failed.'
  637. SLACK_USERNAME: 'GitHub Actions'
  638. SLACK_MESSAGE: |-
  639. ${{ github.repository }}: Artifact verification for static build failed.
  640. Checkout: ${{ steps.checkout.outcome }}
  641. Fetch artifacts: ${{ steps.fetch-artifacts.outcome }}
  642. Verify artifacts: ${{ steps.verify.outcome }}
  643. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  644. if: >-
  645. ${{
  646. failure()
  647. && startsWith(github.ref, 'refs/heads/master')
  648. && github.event_name != 'pull_request'
  649. && github.repository == 'netdata/netdata'
  650. && needs.file-check.outputs.run == 'true'
  651. }}
  652. artifact-verification-updater: # Test the generated dist archive using the updater code.
  653. name: Test Consolidated Artifacts (Updater)
  654. runs-on: ubuntu-latest
  655. needs:
  656. - prepare-upload
  657. - file-check
  658. services:
  659. apache: # This gets used to serve the dist tarball for the updater script.
  660. image: httpd:2.4
  661. ports:
  662. - 8080:80
  663. volumes:
  664. - ${{ github.workspace }}:/usr/local/apache2/htdocs/
  665. steps:
  666. - name: Skip Check
  667. id: skip
  668. if: needs.file-check.outputs.run != 'true'
  669. run: echo "SKIPPED"
  670. - name: Checkout
  671. id: checkout
  672. if: needs.file-check.outputs.run == 'true'
  673. uses: actions/checkout@v4
  674. - name: Fetch artifacts
  675. id: fetch-artifacts
  676. if: needs.file-check.outputs.run == 'true'
  677. uses: Wandalen/wretry.action@v3
  678. with:
  679. action: actions/download-artifact@v4
  680. with: |
  681. name: final-artifacts
  682. path: artifacts
  683. attempt_limit: 3
  684. attempt_delay: 2000
  685. - name: Prepare artifacts directory
  686. id: prepare
  687. if: needs.file-check.outputs.run == 'true'
  688. run: |
  689. mkdir -p download/latest
  690. mv artifacts/* download/latest
  691. ls -al download/latest
  692. - name: Run Updater Check
  693. id: check
  694. if: needs.file-check.outputs.run == 'true'
  695. run: |
  696. docker run --security-opt seccomp=unconfined -e DISABLE_TELEMETRY=1 --network host \
  697. -v $PWD:/netdata -w /netdata \
  698. ubuntu:latest /bin/sh -x /netdata/.github/scripts/run-updater-check.sh
  699. - name: Failure Notification
  700. uses: rtCamp/action-slack-notify@v2
  701. env:
  702. SLACK_COLOR: 'danger'
  703. SLACK_FOOTER: ''
  704. SLACK_ICON_EMOJI: ':github-actions:'
  705. SLACK_TITLE: 'Updater checks failed:'
  706. SLACK_USERNAME: 'GitHub Actions'
  707. SLACK_MESSAGE: |-
  708. ${{ github.repository }}: Updater checks for failed.
  709. Checkout: ${{ steps.checkout.outcome }}
  710. Fetch artifacts: ${{ steps.fetch-artifacts.outcome }}
  711. Prepare artifact directory: ${{ steps.prepare.outcome }}
  712. Updater check: ${{ steps.check.outcome }}
  713. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  714. if: >-
  715. ${{
  716. failure()
  717. && startsWith(github.ref, 'refs/heads/master')
  718. && github.event_name != 'pull_request'
  719. && github.repository == 'netdata/netdata'
  720. && needs.file-check.outputs.run == 'true'
  721. }}
  722. create-nightly: # Create a nightly build release in netdata/netdata-nightlies
  723. name: Create Nightly Release
  724. runs-on: ubuntu-latest
  725. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'nightly' && github.repository == 'netdata/netdata'
  726. needs:
  727. - prepare-upload
  728. - artifact-verification-dist
  729. - artifact-verification-static
  730. steps:
  731. - name: Checkout Main Repo
  732. id: checkout-main
  733. uses: actions/checkout@v4
  734. with:
  735. path: main
  736. - name: Checkout Nightly Repo
  737. id: checkout-nightly
  738. uses: actions/checkout@v4
  739. with:
  740. repository: netdata/netdata-nightlies
  741. path: nightlies
  742. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  743. - name: Retrieve Artifacts
  744. id: fetch
  745. uses: Wandalen/wretry.action@v3
  746. with:
  747. action: actions/download-artifact@v4
  748. with: |
  749. name: final-artifacts
  750. path: final-artifacts
  751. attempt_limit: 3
  752. attempt_delay: 2000
  753. - name: Prepare version info
  754. id: version
  755. run: |
  756. # shellcheck disable=SC2129
  757. echo "version=$(cat main/packaging/version)" >> "${GITHUB_OUTPUT}"
  758. echo "commit=$(cd nightlies && git rev-parse HEAD)" >> "${GITHUB_OUTPUT}"
  759. echo "date=$(date +%F)" >> "${GITHUB_OUTPUT}"
  760. - name: Create Release
  761. id: create-release
  762. uses: ncipollo/release-action@v1
  763. with:
  764. allowUpdates: false
  765. artifactErrorsFailBuild: true
  766. artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/netdata-*.msi'
  767. owner: netdata
  768. repo: netdata-nightlies
  769. body: Netdata nightly build for ${{ steps.version.outputs.date }}.
  770. commit: ${{ steps.version.outputs.commit }}
  771. makeLatest: true
  772. tag: ${{ steps.version.outputs.version }}
  773. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  774. - name: Checkout netdata main Repo # Checkout back to netdata/netdata repo to the update latest packaged versions
  775. id: checkout-netdata
  776. uses: actions/checkout@v4
  777. with:
  778. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  779. - name: Init python environment for publish release metadata
  780. uses: actions/setup-python@v5
  781. id: init-python
  782. with:
  783. python-version: "3.12"
  784. - name: Setup python environment
  785. id: setup-python
  786. run: |
  787. pip install -r .github/scripts/modules/requirements.txt
  788. - name: Check if the version is latest and published
  789. id: check-latest-version
  790. run: |
  791. python .github/scripts/check_latest_versions.py ${{ steps.version.outputs.version }}
  792. - name: SSH setup
  793. id: ssh-setup
  794. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-latest-version.outputs.versions_needs_update == 'true'
  795. uses: shimataro/ssh-key-action@v2
  796. with:
  797. key: ${{ secrets.NETDATABOT_PACKAGES_SSH_KEY }}
  798. name: id_ecdsa
  799. known_hosts: ${{ secrets.PACKAGES_KNOWN_HOSTS }}
  800. - name: Sync release info to packages.netdata.cloud
  801. id: sync-releases
  802. continue-on-error: true
  803. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-latest-version.outputs.versions_needs_update == 'true'
  804. run: |
  805. .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
  806. - name: Sync release info to packages2.netdata.cloud
  807. id: sync-releases2
  808. if: github.event_name == 'workflow_dispatch' && github.repository == 'netdata/netdata' && steps.check-latest-version.outputs.versions_needs_update == 'true'
  809. run: |
  810. .github/scripts/upload-new-version-tags.sh packages.netdata.cloud
  811. - name: Failure Notification
  812. uses: rtCamp/action-slack-notify@v2
  813. env:
  814. SLACK_COLOR: 'danger'
  815. SLACK_FOOTER: ''
  816. SLACK_ICON_EMOJI: ':github-actions:'
  817. SLACK_TITLE: 'Failed to draft release:'
  818. SLACK_USERNAME: 'GitHub Actions'
  819. SLACK_MESSAGE: |-
  820. ${{ github.repository }}: Failed to create nightly release or attach artifacts.
  821. Checkout netdata/netdata: ${{ steps.checkout-main.outcome }}
  822. Checkout netdata/netdata-nightlies: ${{ steps.checkout-nightly.outcome }}
  823. Fetch artifacts: ${{ steps.fetch.outcome }}
  824. Prepare version info: ${{ steps.version.outcome }}
  825. Create release: ${{ steps.create-release.outcome }}
  826. Checkout back netdata/netdata: ${{ steps.checkout-netdata.outcome }}
  827. Init python environment: ${{ steps.init-python.outcome }}
  828. Setup python environment: ${{ steps.setup-python.outcome }}
  829. Check the nearly published release against the advertised: ${{ steps.check-latest-version.outcome }}
  830. Setup ssh: ${{ steps.ssh-setup.outcome }}
  831. Sync release info to packages.netdata.cloud: ${{ steps.sync-releases.outcome }}
  832. Sync release info to packages2.netdata.cloud: ${{ steps.sync-releases2.outcome }}
  833. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  834. if: >-
  835. ${{
  836. failure()
  837. && github.event_name == 'workflow_dispatch'
  838. }}
  839. normalize-tag: # Fix the release tag if needed
  840. name: Normalize Release Tag
  841. runs-on: ubuntu-latest
  842. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'release'
  843. outputs:
  844. tag: ${{ steps.tag.outputs.tag }}
  845. steps:
  846. - name: Normalize Tag
  847. id: tag
  848. run: |
  849. if echo ${{ github.event.inputs.version }} | grep -qE '^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$'; then
  850. echo "tag=v${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
  851. else
  852. echo "tag=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
  853. fi
  854. upload-release: # Create the draft release and upload the build artifacts.
  855. name: Create Release Draft
  856. runs-on: ubuntu-latest
  857. if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'release' && github.repository == 'netdata/netdata'
  858. needs:
  859. - artifact-verification-dist
  860. - artifact-verification-static
  861. - normalize-tag
  862. steps:
  863. - name: Checkout
  864. id: checkout
  865. uses: actions/checkout@v4
  866. - name: Retrieve Artifacts
  867. id: fetch
  868. uses: Wandalen/wretry.action@v3
  869. with:
  870. action: actions/download-artifact@v4
  871. with: |
  872. name: final-artifacts
  873. path: final-artifacts
  874. attempt_limit: 3
  875. attempt_delay: 2000
  876. - name: Create Release
  877. id: create-release
  878. uses: ncipollo/release-action@v1
  879. with:
  880. allowUpdates: false
  881. artifactErrorsFailBuild: true
  882. artifacts: 'final-artifacts/sha256sums.txt,final-artifacts/netdata-*.tar.gz,final-artifacts/netdata-*.gz.run,final-artifacts/netdata-*.msi'
  883. draft: true
  884. tag: ${{ needs.normalize-tag.outputs.tag }}
  885. token: ${{ secrets.NETDATABOT_GITHUB_TOKEN }}
  886. - name: Failure Notification
  887. uses: rtCamp/action-slack-notify@v2
  888. env:
  889. SLACK_COLOR: 'danger'
  890. SLACK_FOOTER: ''
  891. SLACK_ICON_EMOJI: ':github-actions:'
  892. SLACK_TITLE: 'Failed to draft release:'
  893. SLACK_USERNAME: 'GitHub Actions'
  894. SLACK_MESSAGE: |-
  895. ${{ github.repository }}: Failed to create draft release or attach artifacts.
  896. Checkout: ${{ steps.checkout.outcome }}
  897. Fetch artifacts: ${{ steps.fetch.outcome }}
  898. Create draft release: ${{ steps.create-release.outcome }}
  899. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  900. if: >-
  901. ${{
  902. failure()
  903. && github.event_name == 'workflow_dispatch'
  904. }}
  905. - name: Success Notification
  906. uses: rtCamp/action-slack-notify@v2
  907. env:
  908. SLACK_COLOR: 'good'
  909. SLACK_FOOTER: ''
  910. SLACK_ICON_EMOJI: ':github-actions:'
  911. SLACK_TITLE: 'Created agent draft release:'
  912. SLACK_USERNAME: 'GitHub Actions'
  913. SLACK_MESSAGE: "${{ github.repository }}: ${{ steps.create-release.outputs.html_url }}"
  914. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  915. if: >-
  916. ${{
  917. success()
  918. && github.event_name == 'workflow_dispatch'
  919. }}
  920. # Remaining jobs are only used for CI checks, and not as part of the release process
  921. src-matrix: # Generate the shared build matrix for our Linux build tests.
  922. name: Prepare Build Matrix
  923. runs-on: ubuntu-latest
  924. if: github.event_name != 'workflow_dispatch'
  925. outputs:
  926. matrix: ${{ steps.set-matrix.outputs.matrix }}
  927. steps:
  928. - name: Checkout
  929. id: checkout
  930. uses: actions/checkout@v4
  931. - name: Prepare tools
  932. id: prepare
  933. run: |
  934. sudo apt-get update || true
  935. sudo apt-get install -y python3-ruamel.yaml
  936. - name: Read build matrix
  937. id: set-matrix
  938. run: |
  939. matrix="$(.github/scripts/gen-matrix-build.py)"
  940. echo "Generated matrix: ${matrix}"
  941. echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
  942. - name: Failure Notification
  943. uses: rtCamp/action-slack-notify@v2
  944. env:
  945. SLACK_COLOR: 'danger'
  946. SLACK_FOOTER: ''
  947. SLACK_ICON_EMOJI: ':github-actions:'
  948. SLACK_TITLE: 'Build matrix preparation failed:'
  949. SLACK_USERNAME: 'GitHub Actions'
  950. SLACK_MESSAGE: |-
  951. ${{ github.repository }}: Failed to prepare build matrix for build checks.
  952. Checkout: ${{ steps.checkout.outcome }}
  953. Prepare tools: ${{ steps.prepare.outcome }}
  954. Read build matrix: ${{ steps.set-matrix.outcome }}
  955. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  956. if: >-
  957. ${{
  958. failure()
  959. && startsWith(github.ref, 'refs/heads/master')
  960. && github.event_name != 'pull_request'
  961. && github.repository == 'netdata/netdata'
  962. }}
  963. source-build: # Test various source build arrangements.
  964. name: Test Source Build
  965. runs-on: ubuntu-latest
  966. if: github.event_name != 'workflow_dispatch'
  967. needs:
  968. - src-matrix
  969. - file-check
  970. strategy:
  971. fail-fast: false
  972. max-parallel: 8
  973. matrix: ${{ fromJson(needs.src-matrix.outputs.matrix) }}
  974. steps:
  975. - name: Skip Check
  976. id: skip
  977. if: needs.file-check.outputs.run != 'true'
  978. run: echo "SKIPPED"
  979. - name: Checkout
  980. id: checkout
  981. if: needs.file-check.outputs.run == 'true'
  982. uses: actions/checkout@v4
  983. with:
  984. submodules: recursive
  985. - name: Setup Buildx
  986. id: buildx
  987. uses: docker/setup-buildx-action@v3
  988. - name: Build test environment
  989. id: build
  990. uses: Wandalen/wretry.action@v3
  991. with:
  992. action: docker/build-push-action@v6
  993. with: |
  994. push: false
  995. load: true
  996. file: .github/dockerfiles/Dockerfile.build_test
  997. build-args: |
  998. BASE=${{ matrix.distro }}
  999. PRE=${{ matrix.env_prep }}
  1000. RMJSONC=${{ matrix.jsonc_removal }}
  1001. tags: test:${{ matrix.artifact_key }}
  1002. attempt_limit: 3
  1003. attempt_delay: 15000
  1004. - name: netdata-installer on ${{ matrix.distro }}
  1005. id: build-cloud
  1006. if: needs.file-check.outputs.run == 'true'
  1007. run: |
  1008. docker run --security-opt seccomp=unconfined -w /netdata test:${{ matrix.artifact_key }} \
  1009. /bin/sh -c './netdata-installer.sh --dont-wait --dont-start-it --one-time-build ${{ needs.file-check.outputs.skip-go }}'
  1010. - name: Failure Notification
  1011. uses: rtCamp/action-slack-notify@v2
  1012. env:
  1013. SLACK_COLOR: 'danger'
  1014. SLACK_FOOTER: ''
  1015. SLACK_ICON_EMOJI: ':github-actions:'
  1016. SLACK_TITLE: 'Build tests for ${{ matrix.distro }} failed:'
  1017. SLACK_USERNAME: 'GitHub Actions'
  1018. SLACK_MESSAGE: |-
  1019. ${{ github.repository }}: Build tests for ${{ matrix.distro }} failed.
  1020. Checkout: ${{ steps.checkout.outcome }}
  1021. Set up Buildx: ${{ steps.buildx.outcome }}
  1022. Build test environment: ${{ steps.build.outcome }}
  1023. netdata-installer: ${{ steps.build-cloud.outcome }}
  1024. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  1025. if: >-
  1026. ${{
  1027. failure()
  1028. && startsWith(github.ref, 'refs/heads/master')
  1029. && github.event_name != 'pull_request'
  1030. && github.repository == 'netdata/netdata'
  1031. && needs.file-check.outputs.run == 'true'
  1032. }}
  1033. macos-build: # Test building on macOS
  1034. name: Test building on macOS
  1035. runs-on: ${{ matrix.runner }}
  1036. if: github.event_name != 'workflow_dispatch'
  1037. needs:
  1038. - file-check
  1039. strategy:
  1040. fail-fast: false
  1041. max-parallel: 8
  1042. matrix:
  1043. include:
  1044. - name: macos-13
  1045. runner: macos-13
  1046. - name: macos-14-M1
  1047. runner: macos-14
  1048. - name: macos-15-M1
  1049. runner: macos-15
  1050. steps:
  1051. - name: Skip Check
  1052. id: skip
  1053. if: needs.file-check.outputs.run != 'true'
  1054. run: echo "SKIPPED"
  1055. - uses: actions/checkout@v4
  1056. id: checkout
  1057. if: needs.file-check.outputs.run == 'true'
  1058. with:
  1059. submodules: recursive
  1060. - name: Install latest bash
  1061. id: install-bash
  1062. if: needs.file-check.outputs.run == 'true'
  1063. run: |
  1064. brew install bash
  1065. - name: Install netdata dependencies
  1066. id: install-nd-dep
  1067. if: needs.file-check.outputs.run == 'true'
  1068. run: |
  1069. bash ./packaging/installer/install-required-packages.sh --dont-wait --non-interactive netdata-all
  1070. - name: Build from source
  1071. id: build-source
  1072. if: needs.file-check.outputs.run == 'true'
  1073. run: |
  1074. sudo bash ./netdata-installer.sh --install-no-prefix /usr/local/netdata --dont-wait --dont-start-it --one-time-build
  1075. - name: Test Agent start up
  1076. id: test-agent
  1077. if: needs.file-check.outputs.run == 'true'
  1078. run: |
  1079. /usr/local/netdata/usr/sbin/netdata -D > ./netdata.log 2>&1 &
  1080. ./packaging/runtime-check.sh
  1081. - name: Failure Notification
  1082. uses: rtCamp/action-slack-notify@v2
  1083. env:
  1084. SLACK_COLOR: 'danger'
  1085. SLACK_FOOTER: ''
  1086. SLACK_ICON_EMOJI: ':github-actions:'
  1087. SLACK_TITLE: 'Build & test from source macOS failed:'
  1088. SLACK_USERNAME: 'GitHub Actions'
  1089. SLACK_MESSAGE: |-
  1090. ${{ github.repository }}: macOS Build and test.
  1091. Checkout: ${{ steps.checkout.outcome }}
  1092. Setup runner: ${{ steps.install-bash.outcome }}
  1093. Install netdata required packages: ${{ steps.install-nd-dep.outcome }}
  1094. Build from source: ${{ steps.build-source.outcome }}
  1095. Test Agent runtime: ${{ steps.test-agent.outcome }}
  1096. SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
  1097. if: >-
  1098. ${{
  1099. failure()
  1100. && startsWith(github.ref, 'refs/heads/master')
  1101. && github.event_name != 'pull_request'
  1102. && github.repository == 'netdata/netdata'
  1103. }}