Commit ec8aaf3
authored
Add github workflows for stuart CI Builds (#545)
This pull request adds two new workflows and a github action that are
reusable across repositories that use the Stuart CI system.
## New Actions
### `stuart-ci` action
This action is an OS agnostic action that will setup the stuart
environment (`stuart_setup`, `stuart_ci_setup`, `stuart_update`) and run
`stuart_ci_build` with the specified configurations. It provides a
single output, `log-path` which is a path to all logs generated by this
action. It has some performance increases like caching the .git/modules
folder.
### `PackageCi` worfklow
This workflow is an OS agnostic workflow that will setup the entire
runner environment and run CI on the specified packages. This workflow
will generate a build matrix using the provided configuration input to
test multiple packages under multiple conditions. The `package-config`
input is a json string that contains all matrix configuration for the
job (e.g. the input is passed directly to `strategy.matrix` (Examples
below). This input string can be hardcoded or automatically generated.
It has some performance increases like caching the python version and
python dependencies.
### `PackageMatrix` worfklow
This workflow is used to generate a matrix configuration that is
consumed by the `PackageCi` worfklow. This workflow works by discovering
all packages in a repository and generating a configuration for it. This
workflow has two main inputs: (1) `default-config` which is the default
list of matrix configurations to apply for each discovered package in
the workspace and (2) `package-config` which is a way to define more
specific configuration for a specific package, which will replace the
`default-config`.
`PackageMatrix` also supports running `stuart_ci_build`, which will
filter the discovered packages in the workspace to only package's that
actually need to be tested. This is useful as it prevents generating a
runner for a package that does not need tested.
## Usage Examples
The three actions / workflows above are not sync'd to repositories. It
is expected that a repository maintains its own final github workflow
that consumes these packages with it's specific configuration. An
example can be seen below
<details>
<summary> Example Leaf node worfklow </summary>
```yaml
# A workflow to build EDKII packages using the CLANGPDB toolchain in windows and ubuntu environments.
##
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
name: CLANGPDB Package CI
on:
workflow_dispatch:
push:
branches:
- release/202511
pull_request:
branches:
- release/202511
jobs:
package-matrix:
name: Gather Repository Packages
uses: microsoft/mu_devops/.github/workflows/PackageMatrix.yml@personal/joeyvagedes/ci-workflow
with:
ci-config: '.pytool/CISettings.py'
# Manually declared package configurations.
package-config: |
- packages: MdeModulePkg
targets: RELEASE
toolchain: CLANGPDB
- packages: MdeModulePkg
targets: DEBUG
toolchain: CLANGPDB
# Default config applied to any undeclared packages in the repo
default-config: |
targets: ["DEBUG,RELEASE"]
toolchain: ["CLANGPDB"]
python-version: '3.12'
windows-ci:
name: Windows CLANGPDB CI
if: ${{ needs.package-matrix.outputs.matrix != '' }}
needs: package-matrix
uses: microsoft/mu_devops/.github/workflows/PackageCi.yml@personal/joeyvagedes/ci-workflow
with:
package-config: ${{ needs.package-matrix.outputs.matrix }}
runner: windows-latest
python-version: '3.12'
setup-cmd: setup
ubuntu-ci:
name: Ubuntu CLANGPDB CI
if: ${{ needs.package-matrix.outputs.matrix != '' }}
needs: package-matrix
uses: microsoft/mu_devops/.github/workflows/PackageCi.yml@personal/joeyvagedes/ci-workflow
with:
package-config: ${{ needs.package-matrix.outputs.matrix }}
runner: ubuntu-latest
container: ghcr.io/microsoft/mu_devops/ubuntu-24-test:latest
python-version: '3.12'
setup-cmd: setup
```
</details>
## Example CI runs
Below is an example of a pull request that generates a large amount of
runners because it changes file that is not specific to a package, which
results in all packages needing tested:
<img width="706" height="385" alt="image"
src="https://github.com/user-attachments/assets/0401d480-2e50-4b59-8656-5b9577227326"
/>
Below is an example of a pull request that generates only a few runners,
as stuart_pr_eval decided only a few packages required testing:
<img width="695" height="380" alt="image"
src="https://github.com/user-attachments/assets/686a5229-1114-4964-bd8c-857f2fa23e70"
/>1 parent cd2668a commit ec8aaf3
File tree
6 files changed
+632
-1
lines changed- .github
- actions/stuart-ci
- workflows
- .sync
- workflows/leaf
6 files changed
+632
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments