Skip to content

Commit 11a7db2

Browse files
Convert ADO pipelines to GitHub actions (#321)
* Convert ADO pipelines to GitHub actions * Remove version in uses as not valid for local workflows * Fix cmake path and add deploy url affix * Add SMP build job * Fix code coverage URL * Add affix to titles of steps * Remove ADO pipelines * Add affix to titles of code coverage * separate PR results for multiple jobs * Revert "separate PR results for multiple jobs" This reverts commit 6da1354. * separate PR results for multiple jobs
1 parent d17d7bd commit 11a7db2

File tree

4 files changed

+166
-159
lines changed

4 files changed

+166
-159
lines changed
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# This is a basic workflow that is manually triggered
2+
3+
name: regression_template
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
install_script:
9+
default: './scripts/install.sh'
10+
required: false
11+
type: string
12+
build_script:
13+
default: './scripts/build.sh'
14+
required: false
15+
type: string
16+
test_script:
17+
default: './scripts/test.sh'
18+
required: false
19+
type: string
20+
cmake_path:
21+
default: './test/cmake'
22+
required: false
23+
type: string
24+
deploy_url_affix:
25+
default: ''
26+
required: false
27+
type: string
28+
result_affix:
29+
default: ''
30+
required: false
31+
type: string
32+
33+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
34+
jobs:
35+
# This workflow contains a single job called "linux_job"
36+
run_tests:
37+
permissions:
38+
contents: read
39+
issues: read
40+
checks: write
41+
pull-requests: write
42+
43+
# The type of runner that the job will run on
44+
runs-on: ubuntu-latest
45+
46+
# Steps represent a sequence of tasks that will be executed as part of the job
47+
steps:
48+
- name: Check out the repository
49+
uses: actions/checkout@v4
50+
with:
51+
submodules: true
52+
53+
- name: Install softwares
54+
run: ${{ inputs.install_script }}
55+
56+
- name: Build
57+
run: ${{ inputs.build_script }}
58+
59+
- name: Test
60+
run: ${{ inputs.test_script }}
61+
62+
- name: Publish Test Results
63+
uses: EnricoMi/[email protected]
64+
if: always()
65+
with:
66+
check_name: Test Results ${{ inputs.result_affix }}
67+
files: |
68+
${{ inputs.cmake_path }}/build/*/*.xml
69+
70+
- name: Upload Test Results
71+
if: success() || failure()
72+
uses: actions/[email protected]
73+
with:
74+
name: test_reports
75+
path: |
76+
${{ inputs.cmake_path }}/build/*.txt
77+
${{ inputs.cmake_path }}/build/*/Testing/**/*.xml
78+
79+
- name: Configure GitHub Pages
80+
uses: actions/[email protected]
81+
82+
- name: Upload GitHub Pages artifact
83+
uses: actions/[email protected]
84+
with:
85+
path: ${{ inputs.cmake_path }}/coverage_report/default_build_coverage
86+
87+
- name: Generate Code Coverage Results Summary
88+
uses: irongut/[email protected]
89+
with:
90+
filename: ${{ inputs.cmake_path }}/coverage_report/default_build_coverage.xml
91+
format: markdown
92+
badge: true
93+
hide_complexity: true
94+
output: file
95+
96+
- name: Write Code Coverage Summary
97+
run: |
98+
echo "## Coverage Report ${{ inputs.result_affix }}" >> $GITHUB_STEP_SUMMARY
99+
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
100+
101+
- name: Create CheckRun for Code Coverage
102+
if: (github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == github.repository)
103+
uses: LouisBrunner/[email protected]
104+
with:
105+
token: ${{ secrets.GITHUB_TOKEN }}
106+
name: Code Coverage ${{ inputs.result_affix }}
107+
conclusion: ${{ job.status }}
108+
output: |
109+
{"summary":"Coverage Report"}
110+
output_text_description_file: code-coverage-results.md
111+
112+
- name: Add Code Coverage PR Comment
113+
if: (github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == github.repository)
114+
uses: marocchino/sticky-pull-request-comment@v2
115+
with:
116+
header: Code Coverage ${{ inputs.result_affix }}
117+
path: code-coverage-results.md
118+
119+
deploy_code_coverage:
120+
runs-on: ubuntu-latest
121+
if: github.event_name == 'push'
122+
needs: run_tests
123+
environment:
124+
name: github-pages
125+
url: ${{ steps.deployment.outputs.page_url }}${{ inputs.deploy_url_affix }}
126+
permissions:
127+
pages: write
128+
id-token: write
129+
130+
steps:
131+
- name: Deploy GitHub Pages site
132+
id: deployment
133+
uses: actions/[email protected]
134+
135+
- name: Write Code Coverage Report URL
136+
run: |
137+
echo '[Open Coverage Report](${{ steps.deployment.outputs.page_url }}${{ inputs.deploy_url_affix }})' >> $GITHUB_STEP_SUMMARY

.github/workflows/regression_test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: regression_test
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the master branch
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
tx:
15+
uses: ./.github/workflows/regression_template.yml
16+
with:
17+
build_script: ./scripts/build_tx.sh
18+
test_script: ./scripts/test_tx.sh
19+
cmake_path: ./test/tx/cmake
20+
deploy_url_affix: tx/
21+
result_affix: ThreadX
22+
tx_smp:
23+
uses: ./.github/workflows/regression_template.yml
24+
with:
25+
build_script: ./scripts/build_smp.sh
26+
test_script: ./scripts/test_smp.sh
27+
cmake_path: ./test/smp/cmake
28+
deploy_url_affix: smp/
29+
result_affix: SMP

.pipelines/smp.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.pipelines/tx.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)