-
Notifications
You must be signed in to change notification settings - Fork 58
176 lines (156 loc) · 6.64 KB
/
platform-ci.yml
File metadata and controls
176 lines (156 loc) · 6.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# A workflow to build the platform(s) in this repository using certain configurations.
#
##
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
name: "Platform CI"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
# A job to produce the environment constants for this repository, so that the build job can
# generate its matrix.
vars:
name: Get Repository Constants
uses: ./.github/workflows/constants.yml
# Builds the platform(s) in this repository as defined by the matrix.
build:
name: ${{ matrix.platform }} ${{ matrix.architecture }} ${{ matrix.target }} ${{ matrix.tool-chain }} (${{ matrix.os }})
needs:
- vars
runs-on: ${{ matrix.os }}
# If matrix.container is not defined, then `image` will be null and no container will be used.
container:
image: ${{ matrix.container || null }}
options: --security-opt seccomp=unconfined
strategy:
# This setting prevents the cancellation of other jobs when one job fails.
fail-fast: false
matrix:
target: [DEBUG, RELEASE]
tool-chain: [CLANGPDB, VS2022, GCC5]
os: [windows-latest, ubuntu-latest]
container: ['', '${{ needs.vars.outputs.container-image}}']
platform: [Q35, SBSA]
architecture: ['', 'IA32,X64']
exclude:
# Exclude container builds on Windows
- os: windows-latest
container: ${{ needs.vars.outputs.container-image }}
# Exclude non-container builds on Ubuntu
- os: ubuntu-latest
container: ''
# Exclude SBSA X64 builds since they are not supported
- platform: SBSA
architecture: X64
# Exclude SBSA IA32,X64 builds since they are not supported
- platform: SBSA
architecture: "IA32,X64"
#########################################
# Temporary Filters until only CLANGPDB #
#########################################
# Exclude GCC5 builds on Windows
- os: windows-latest
tool-chain: GCC5
# Exclude VS builds on Ubuntu
- os: ubuntu-latest
tool-chain: VS2022
# Exclude VS SBSA builds
- platform: SBSA
tool-chain: VS2022
##############################
# Temporary Filters for Bugs #
##############################
# Exclude CLANGPDB RELEASE builds due to PEI bug
- tool-chain: CLANGPDB
target: RELEASE
# Exclude SBSA CLANG builds due to ldr assembly issue
- tool-chain: CLANGPDB
platform: SBSA
steps:
# Checkout the repository to the runner or container
- name: Checkout repository
uses: actions/checkout@v6
- name: Set platform config path
id: set-config
shell: bash
run: |
case "${{ matrix.platform }}" in
Q35)
CONFIG_PATH="Platforms/QemuQ35Pkg/PlatformBuild.py"
;;
SBSA)
CONFIG_PATH="Platforms/QemuSbsaPkg/PlatformBuild.py"
;;
*)
echo "Unknown platform: ${{ matrix.platform }}"
exit 1
;;
esac
echo "path=$CONFIG_PATH" >> "$GITHUB_OUTPUT"
# $GITHUB_WORKSPACE is mu_tiano_platforms/mu_tiano_platforms, which results in paths
# for certain drivers being too long and resulting in build failures.
- name: Create short path alias
id: short-path
if: runner.os == 'Windows'
shell: bash
run: |
subst S: "$(cygpath -w '${{ github.workspace }}')"
echo "short-path=S:" >> $GITHUB_OUTPUT
# Configure git for use in the container. Specifically needed for the FFA builds
- name: Container Configuration
if: ${{ matrix.container != null }}
run: |
git config --global --add safe.directory '*'
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
# Set the version of Python to use when outside of a container. Otherwise just use what's
# in the container.
- name: Setup Python ${{ needs.vars.outputs.python-version }}
if: ${{ matrix.container == null }}
uses: actions/setup-python@v6
with:
python-version: ${{ needs.vars.outputs.python-version }}
cache: 'pip'
cache-dependency-path: 'pip-requirements.txt'
# Install the pip dependencies needed to run stuart for the platform(s)
- name: Install dependencies
run: pip install -r pip-requirements.txt
# Run the build-platform action, which calls stuart_setup, stuart_update, and stuart_build
- name: Prepare and Build ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.tool-chain}}
id: build-platform
uses: ./.github/actions/build-platform
with:
command: 'build'
platform-config: ${{ steps.set-config.outputs.path }}
platform-name: ${{ matrix.platform }}
architecture: ${{ matrix.architecture }}
target: ${{ matrix.target }}
tool-chain: ${{ matrix.tool-chain }}
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 }}'
working-directory: ${{ steps.short-path.outputs.short-path || github.workspace }}
- name: Run ${{ matrix.platform }} ${{ matrix.target }} ${{ matrix.tool-chain}}
timeout-minutes: 15
uses: ./.github/actions/build-platform
with:
command: 'flash'
platform-config: ${{ steps.set-config.outputs.path }}
platform-name: ${{ matrix.platform }}
architecture: ${{ matrix.architecture }}
target: ${{ matrix.target }}
tool-chain: ${{ matrix.tool-chain }}
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 }}'
working-directory: ${{ steps.short-path.outputs.short-path || github.workspace }}
- name: Publish Logs
if: always()
uses: actions/upload-artifact@v7
with:
name: build-logs-${{ matrix.platform }}-${{ matrix.architecture }}-${{ matrix.target }}-${{ matrix.tool-chain }}-${{ matrix.os }}
path: ${{ steps.build-platform.outputs.log-path }}