Skip to content

Add github workflows for stuart CI Builds#545

Merged
Javagedes merged 6 commits intomainfrom
personal/joeyvagedes/ci-workflow
Mar 30, 2026
Merged

Add github workflows for stuart CI Builds#545
Javagedes merged 6 commits intomainfrom
personal/joeyvagedes/ci-workflow

Conversation

@Javagedes
Copy link
Copy Markdown
Contributor

@Javagedes Javagedes commented Mar 30, 2026

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

Example Leaf node worfklow
# 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

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:

image

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:

image

@Javagedes
Copy link
Copy Markdown
Contributor Author

https://github.com/Javagedes/mu_basecore/actions/runs/23758696328

Latest test run before creating the PR.

Comment thread .github/actions/stuart-ci/action.yml Outdated
Comment thread .github/actions/stuart-ci/action.yml Outdated
Comment thread .github/actions/stuart-ci/action.yml Outdated
Comment thread .sync/workflows/leaf/PackageCi.yml
Comment thread .github/workflows/PackageMatrix.yml
Comment thread .sync/Files.yml
@Javagedes Javagedes force-pushed the personal/joeyvagedes/ci-workflow branch from 1d944d2 to 842fd4c Compare March 30, 2026 22:24
@Javagedes Javagedes merged commit ec8aaf3 into main Mar 30, 2026
4 checks passed
@Javagedes Javagedes deleted the personal/joeyvagedes/ci-workflow branch March 30, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants