nightly #1363
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: nightly | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| trigger_toolbox_build: | |
| description: 'Trigger cmsis-toolbox build as a part of this workflow' | |
| required: false | |
| default: false | |
| type: boolean | |
| schedule: | |
| - cron: '0 0 * * *' | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: nightly-${{ github.ref }}-${{ github.event_name }} | |
| cancel-in-progress: false | |
| jobs: | |
| buildmgr: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| uses: ./.github/workflows/buildmgr.yml | |
| secrets: inherit | |
| packchk: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| uses: ./.github/workflows/packchk.yml | |
| secrets: inherit | |
| packgen: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| uses: ./.github/workflows/packgen.yml | |
| secrets: inherit | |
| projmgr: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| uses: ./.github/workflows/projmgr.yml | |
| secrets: inherit | |
| svdconv: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| uses: ./.github/workflows/svdconv.yml | |
| secrets: inherit | |
| test_libs: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| uses: ./.github/workflows/test_libs.yml | |
| secrets: inherit | |
| coverage: | |
| if: github.repository == 'Open-CMSIS-Pack/devtools' | |
| runs-on: ubuntu-22.04 | |
| needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ] | |
| steps: | |
| - name: Harden Runner | |
| if: ${{ !github.event.repository.private }} | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install lcov | |
| - name: Download coverage report | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: coverage-report-* | |
| path: coverage/ | |
| merge-multiple: true | |
| - name: Consolidate coverage data | |
| run: | | |
| lcov --rc lcov_branch_coverage=1 \ | |
| --add-tracefile coverage_packchk.info \ | |
| -a coverage_packgen.info \ | |
| -a coverage_projmgr.info \ | |
| -a coverage_buildmgr.info \ | |
| -a coverage_svdconv.info \ | |
| -o merged_coverage.info | |
| working-directory: coverage/ | |
| - name: Archive merged coverage report | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: merged-coverage-report | |
| path: ./coverage/merged_coverage.info | |
| if-no-files-found: error | |
| publish-test-results: | |
| if: always() && github.repository == 'Open-CMSIS-Pack/devtools' | |
| name: Publish Test Results | |
| runs-on: ubuntu-22.04 | |
| needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ] | |
| permissions: | |
| checks: write | |
| pull-requests: write | |
| steps: | |
| - name: Harden Runner | |
| if: ${{ !github.event.repository.private }} | |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | |
| with: | |
| egress-policy: audit | |
| - name: Download and Extract Artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| path: artifacts | |
| - name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0 | |
| with: | |
| commit: ${{ github.sha }} | |
| report_individual_runs: true | |
| files: "artifacts/**/*.xml" | |
| # Triggers the cmsis-toolbox nightly workflow in the separate repository | |
| trigger-toolbox-nightly: | |
| needs: [ publish-test-results, coverage ] | |
| if: >- | |
| success() && | |
| github.repository == 'Open-CMSIS-Pack/devtools' && | |
| (github.event_name == 'schedule' || github.event.inputs.trigger_toolbox_build) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Trigger cmsis-toolbox Nightly | |
| run: | | |
| curl --fail-with-body --show-error --silent -X POST \ | |
| -H "Authorization: Bearer ${{ secrets.CROSS_REPO_TOOLBOX_TOKEN }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Content-Type: application/json" \ | |
| https://api.github.com/repos/Open-CMSIS-Pack/cmsis-toolbox/actions/workflows/nightly.yml/dispatches \ | |
| -d '{"ref":"main","inputs":{"trigger_extension_build":"true","use_nightly_devtools":"${{ github.event_name == 'schedule' && 'true' || 'false' }}"}}' |