|
8 | 8 | permissions: |
9 | 9 | contents: write |
10 | 10 |
|
| 11 | +concurrency: |
| 12 | + group: nightly-${{ github.ref }}-${{ github.event_name }} |
| 13 | + cancel-in-progress: false |
| 14 | + |
11 | 15 | jobs: |
12 | 16 | buildmgr: |
13 | 17 | if: github.repository == 'Open-CMSIS-Pack/devtools' |
14 | 18 | uses: ./.github/workflows/buildmgr.yml |
15 | 19 | secrets: inherit |
| 20 | + |
16 | 21 | packchk: |
| 22 | + if: always() |
17 | 23 | needs: [buildmgr] |
18 | 24 | uses: ./.github/workflows/packchk.yml |
19 | 25 | secrets: inherit |
| 26 | + |
20 | 27 | packgen: |
| 28 | + if: always() |
21 | 29 | needs: [packchk] |
22 | 30 | uses: ./.github/workflows/packgen.yml |
23 | 31 | secrets: inherit |
| 32 | + |
24 | 33 | projmgr: |
| 34 | + if: always() |
25 | 35 | needs: [packgen] |
26 | 36 | uses: ./.github/workflows/projmgr.yml |
27 | 37 | secrets: inherit |
| 38 | + |
28 | 39 | svdconv: |
| 40 | + if: always() |
29 | 41 | needs: [projmgr] |
30 | 42 | uses: ./.github/workflows/svdconv.yml |
31 | 43 | secrets: inherit |
| 44 | + |
32 | 45 | test_libs: |
| 46 | + if: always() |
33 | 47 | needs: [svdconv] |
34 | 48 | uses: ./.github/workflows/test_libs.yml |
| 49 | + secrets: inherit |
| 50 | + |
35 | 51 | coverage: |
| 52 | + if: always() |
36 | 53 | runs-on: ubuntu-22.04 |
37 | 54 | needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ] |
| 55 | + |
38 | 56 | steps: |
39 | 57 | - name: Harden Runner |
40 | 58 | if: ${{ !github.event.repository.private }} |
|
45 | 63 | - name: Install dependencies |
46 | 64 | run: | |
47 | 65 | sudo apt-get update |
48 | | - sudo apt-get install \ |
49 | | - lcov |
| 66 | + sudo apt-get install -y --no-install-recommends lcov |
50 | 67 |
|
51 | 68 | - name: Download coverage report |
52 | 69 | uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 |
|
57 | 74 |
|
58 | 75 | - name: Consolidate coverage data |
59 | 76 | run: | |
60 | | - 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 |
| 77 | + lcov --rc lcov_branch_coverage=1 \ |
| 78 | + --add-tracefile coverage_packchk.info \ |
| 79 | + -a coverage_packgen.info \ |
| 80 | + -a coverage_projmgr.info \ |
| 81 | + -a coverage_buildmgr.info \ |
| 82 | + -a coverage_svdconv.info \ |
| 83 | + -o merged_coverage.info |
61 | 84 | working-directory: coverage/ |
62 | 85 |
|
63 | 86 | - name: Archive merged coverage report |
|
66 | 89 | name: merged-coverage-report |
67 | 90 | path: ./coverage/merged_coverage.info |
68 | 91 | if-no-files-found: error |
| 92 | + |
| 93 | + publish-test-results: |
| 94 | + if: github.repository == 'Open-CMSIS-Pack/devtools' |
| 95 | + name: Publish Test Results |
| 96 | + runs-on: ubuntu-22.04 |
| 97 | + needs: [ buildmgr, packchk, packgen, projmgr, svdconv, test_libs ] |
| 98 | + permissions: |
| 99 | + checks: write |
| 100 | + pull-requests: write |
| 101 | + steps: |
| 102 | + - name: Harden Runner |
| 103 | + if: ${{ !github.event.repository.private }} |
| 104 | + uses: step-security/harden-runner@6c3c2f2c1c457b00c10c4848d6f5491db3b629df # v2.18.0 |
| 105 | + with: |
| 106 | + egress-policy: audit |
| 107 | + |
| 108 | + - name: Download and Extract Artifacts |
| 109 | + env: |
| 110 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 111 | + run: | |
| 112 | + mkdir -p artifacts && cd artifacts |
| 113 | +
|
| 114 | + artifacts_url="https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts" |
| 115 | + gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while IFS=$'\t' read -r name url; do |
| 116 | + gh api "$url" > "${name}.zip" |
| 117 | + unzip -q -o -d "${name}" "${name}.zip" |
| 118 | + rm "${name}.zip" |
| 119 | + done |
| 120 | +
|
| 121 | + - name: Publish Test Results |
| 122 | + uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0 |
| 123 | + with: |
| 124 | + commit: ${{ github.sha }} |
| 125 | + report_individual_runs: true |
| 126 | + files: "artifacts/**/*.xml" |
0 commit comments