Skip to content

Commit

Permalink
[REBASE&FF] Repo File Sync: Enable code coverage uploads to codecov (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
uefibot authored and kenlautner committed Dec 20, 2023
1 parent acb00a1 commit 98cf65d
Show file tree
Hide file tree
Showing 14 changed files with 359 additions and 2 deletions.
121 changes: 121 additions & 0 deletions .azurepipelines/MuDevOpsWrapper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
## @file
# Azure Pipeline build file for a build using mu_devops.
#
# To upload coverage results, set `coverage_upload_target` to `ado` or `codecov`.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

resources:
repositories:
- repository: mu_devops
type: github
endpoint: microsoft
name: microsoft/mu_devops
ref: refs/tags/v9.0.1

parameters:
- name: do_ci_build
displayName: Perform Stuart CI Build
type: boolean
default: true
- name: do_ci_setup
displayName: Perform Stuart CI Setup
type: boolean
default: true
- name: do_non_ci_build
displayName: Perform non-CI Stuart Build
type: boolean
default: false
- name: do_non_ci_setup
displayName: Perform non-CI Stuart Setup
type: boolean
default: false
- name: do_pr_eval
displayName: Perform Stuart PR Evaluation
type: boolean
default: true
- name: container_build
displayName: Flag for whether this repo should do stuart_setup
type: boolean
default: false
- name: os_type
displayName: OS type on the self-hosted agent pools
type: string
values:
- Windows_NT
- Linux
default: Windows_NT
- name: build_matrix
displayName: Build matrix for this repository
type: object
- name: pool_name
displayName: Variable name that hosts pool name to be used for self-hosted agents
type: string
default: pool_name
- name: extra_install_step
displayName: Extra Install Steps
type: stepList
default:
- script: echo No extra steps provided
- name: extra_jobs
displayName: Extra Jobs to be run after build
type: jobList
default: []
- name: rust_build
displayName: Whether Rust code is being built
type: boolean
default: false
- name: extra_cargo_steps
displayName: Extra Steps to Run Before Standard Cargo Steps
type: stepList
default:
- script: echo No extra cargo steps provided

jobs:
- template: Jobs/PrGate.yml@mu_devops
parameters:
linux_container_image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:1082f35
${{ if eq(parameters.rust_build, true) }}:
linux_container_options: --security-opt seccomp=unconfined
do_ci_build: ${{ parameters.do_ci_build }}
do_ci_setup: ${{ parameters.do_ci_setup }}
do_pr_eval: ${{ parameters.do_pr_eval }}
do_non_ci_setup: ${{ parameters.do_non_ci_setup }}
do_non_ci_build: ${{ parameters.do_non_ci_build }}
build_matrix: ${{ parameters.build_matrix }}
os_type: ${{ parameters.os_type }}
pool_name: ${{ parameters.pool_name }}
extra_install_step: ${{ parameters.extra_install_step }}
tool_chain_tag: $(tool_chain_tag)
vm_image: $(vm_image)
container_build: ${{ parameters.container_build }}
rust_build: ${{ parameters.rust_build }}

- ${{ if eq(parameters.rust_build, true) }}:
- job: CargoCmds
displayName: Workspace Cargo Commands

container:

image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:1082f35
options: --user root --name mu_devops_build_container --security-opt seccomp=unconfined

steps:
- checkout: self
fetchDepth: 1
clean: true
- ${{ parameters.extra_cargo_steps }}
- template: Steps/RustCargoSteps.yml@mu_devops
parameters:
container_build: true

- ${{ parameters.extra_jobs }}

1 change: 1 addition & 0 deletions .azurepipelines/Ubuntu-GCC5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ resources:
variables:
- group: architectures-arm-64-x86-64
- group: tool-chain-ubuntu-gcc
- group: coverage

jobs:
- template: Matrix-Build-Job.yml
Expand Down
1 change: 1 addition & 0 deletions .azurepipelines/Windows-VS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ resources:
variables:
- group: architectures-x86-64
- group: tool-chain-windows-visual-studio-latest
- group: coverage

jobs:
- template: Matrix-Build-Job.yml
Expand Down
12 changes: 12 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## @file
# codecov upload configuration file to carryforward coverage results of
# packages that do not upload coverage results for a given pull request.
##
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
flags:
BoardModulePkg:
carryforward: true
MinPlatformPkg:
carryforward: true
29 changes: 29 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow automatically approves pull requests under certain conditions.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# NOTE: This file uses a reusable workflow. Do not make changes to the file that should be made
# in the common/reusable workflow.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: Auto Approve Pull Request

on:
pull_request_target:
types:
- opened
- reopened

jobs:
approval_check:
if: |
github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'uefibot'
uses: microsoft/mu_devops/.github/workflows/[email protected]
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow automatically merges pull requests under certain conditions.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# NOTE: This file uses a reusable workflow. Do not make changes to the file that should be made
# in the common/reusable workflow.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: Auto Merge Pull Request

on:
pull_request_target:
types:
- opened
- reopened
- synchronize

jobs:
merge_check:
if: |
github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'uefibot'
uses: microsoft/mu_devops/.github/workflows/[email protected]
secrets: inherit
21 changes: 21 additions & 0 deletions .github/workflows/issue-assignment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This workflow provides actions that should be applied when an issue is assigned.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: React to Issue Assignment

on:
issues:
types: assigned

jobs:
apply:
uses: microsoft/mu_devops/.github/workflows/[email protected]
34 changes: 34 additions & 0 deletions .github/workflows/label-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow automatically applies labels to GitHub issues and pull requests based on the
# file paths in a pull request or content in the body of an issue or pull request.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# NOTE: This file uses a reusable workflow. Do not make changes to the file that should be made
# in the common/reusable workflow.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: Apply Issue and PR Labels

on:
issues:
types:
- edited
- opened
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize
workflow_dispatch:

jobs:
apply:
uses: microsoft/mu_devops/.github/workflows/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ on:

jobs:
sync:
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@main
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v7.2.0
54 changes: 54 additions & 0 deletions .github/workflows/pull-request-formatting-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This workflow validates basic pull request formatting requirements are met.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: Validate Pull Request Formatting

on:
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize

jobs:
validate_pr:
runs-on: ubuntu-latest
steps:
- run: |
prTitle="$(gh api graphql -F owner=$OWNER -F name=$REPO -F pr_number=$PR_NUMBER -f query='
query($name: String!, $owner: String!, $pr_number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $pr_number) {
title
}
}
}')"
if [[ "${prTitle}" == *"Personal/"* ]]; then
gh pr comment $PR_URL --body "⚠️ Please add a meaningful PR title (remove the 'Personal/' prefix from the title)."
echo 'VALIDATION_ERROR=true' >> $GITHUB_ENV
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
PR_NUMBER: ${{ github.event.number }}
PR_URL: ${{ github.event.pull_request.html_url }}
REPO: ${{ github.event.repository.name }}
- name: Check for Validation Errors
if: env.VALIDATION_ERROR
uses: actions/github-script@v6
with:
script: |
core.setFailed('PR Formatting Validation Check Failed!')
31 changes: 31 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow automatically drafts new project releases so it is obvious
# what a current release will look like at any time.
#
# It takes advantage of the labels used in Project Mu to automatically categorize
# the types of changes in a given release. In addition, the semantic version of
# the code is constantly maintained based on Project Mu label conventions to ensure
# semantic versioning is followed and a release version is always ready.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# For more information, see:
# https://github.com/release-drafter/release-drafter

name: Update Release Draft

on:
push:
branches:
- release/202302

jobs:
draft:
uses: microsoft/mu_devops/.github/workflows/[email protected]
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ on:

jobs:
check:
uses: microsoft/mu_devops/.github/workflows/Stale.yml@main
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v7.2.0
22 changes: 22 additions & 0 deletions .github/workflows/triage-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow assists with initial triage of new issues by applying
# labels based on data provided in the issue.
#
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
# instead of the file in this repo.
#
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#

name: Initial Triage for New Issue

on:
issues:
types: [ opened ]

jobs:
triage:
uses: microsoft/mu_devops/.github/workflows/[email protected]
1 change: 1 addition & 0 deletions pip-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ edk2-pytool-extensions~=0.17.0 # MU_CHANGE - update to 0.17.0 or later
edk2-basetools==0.1.13 # MU_CHANGE - update to 0.1.13 or later
antlr4-python3-runtime==4.7.1
regex
pygount==1.6.1

0 comments on commit 98cf65d

Please sign in to comment.