Skip to content

Commit e7c8223

Browse files
committed
Add Code Coverage matrix entries
1 parent 342cc58 commit e7c8223

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

.github/workflows/platform-ci.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ on:
1616
branches:
1717
- main
1818

19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
1923
jobs:
2024

2125
# A job to produce the environment constants for this repository, so that the build job can
@@ -49,6 +53,21 @@ jobs:
4953
container: ['', '${{ needs.vars.outputs.container-image}}']
5054
platform: [Q35, SBSA]
5155
architecture: ['', 'IA32,X64']
56+
stuart-args: ['SHUTDOWN_AFTER_RUN=TRUE FILE_REGEX=*TestApp*.efi RUN_TESTS=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=${{ needs.vars.outputs.qemu-core-count }}']
57+
58+
include:
59+
# Q35 Code Coverage
60+
- target: NOOPT
61+
tool-chain: VS2022
62+
os: windows-latest
63+
platform: Q35_TEST
64+
stuart-args: 'CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary'
65+
# SBSA Code Coverage
66+
- target: NOOPT
67+
tool-chain: VS2022
68+
os: windows-latest
69+
platform: SBSA_TEST
70+
stuart-args: 'CODE_COVERAGE=TRUE CC_FULL=TRUE CC_FLATTEN=TRUE REPORTTYPES=Cobertura,HtmlSummary,JsonSummary'
5271

5372
exclude:
5473
# Exclude container builds on Windows
@@ -101,6 +120,12 @@ jobs:
101120
SBSA)
102121
CONFIG_PATH="Platforms/QemuSbsaPkg/PlatformBuild.py"
103122
;;
123+
Q35_TEST)
124+
CONFIG_PATH="Platforms/QemuQ35Pkg/Test/PlatformTest.py"
125+
;;
126+
SBSA_TEST)
127+
CONFIG_PATH="Platforms/QemuSbsaPkg/Test/PlatformTest.py"
128+
;;
104129
*)
105130
echo "Unknown platform: ${{ matrix.platform }}"
106131
exit 1
@@ -140,6 +165,15 @@ jobs:
140165
# Install the pip dependencies needed to run stuart for the platform(s)
141166
- name: Install dependencies
142167
run: pip install -r pip-requirements.txt
168+
169+
- name: Install coverage tools
170+
if: ${{ contains(matrix.platform, 'TEST') && runner.os == 'Windows' }}
171+
run: |
172+
dotnet tool install -g dotnet-reportgenerator-globaltool
173+
174+
Invoke-WebRequest -Uri https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.9.0/OpenCppCoverageSetup-x64-0.9.9.0.exe -OutFile ${{ runner.temp }}\OpenCppCoverageInstall.exe
175+
Start-Process -FilePath "${{ runner.temp }}\OpenCppCoverageInstall.exe" -ArgumentList "/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-" -NoNewWindow -Wait
176+
echo "C:\Program Files\OpenCppCoverage" >> $env:GITHUB_PATH
143177
144178
# Run the build-platform action, which calls stuart_setup, stuart_update, and stuart_build
145179
- name: Prepare and Build ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.tool-chain}}
@@ -152,7 +186,7 @@ jobs:
152186
architecture: ${{ matrix.architecture }}
153187
target: ${{ matrix.target }}
154188
tool-chain: ${{ matrix.tool-chain }}
155-
stuart-args: 'SHUTDOWN_AFTER_RUN=TRUE FILE_REGEX=*TestApp*.efi RUN_TESTS=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=${{ needs.vars.outputs.qemu-core-count }}'
189+
stuart-args: ${{ matrix.stuart-args }}
156190
working-directory: ${{ steps.short-path.outputs.short-path || github.workspace }}
157191

158192
- name: Run ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.tool-chain}}
@@ -164,7 +198,7 @@ jobs:
164198
architecture: ${{ matrix.architecture }}
165199
target: ${{ matrix.target }}
166200
tool-chain: ${{ matrix.tool-chain }}
167-
stuart-args: 'SHUTDOWN_AFTER_RUN=TRUE FILE_REGEX=*TestApp*.efi RUN_TESTS=TRUE QEMU_HEADLESS=TRUE BLD_*_QEMU_CORE_NUM=${{ needs.vars.outputs.qemu-core-count }}'
201+
stuart-args: ${{ matrix.stuart-args }}
168202
working-directory: ${{ steps.short-path.outputs.short-path || github.workspace }}
169203

170204
- name: Publish Logs

0 commit comments

Comments
 (0)