Skip to content

Commit

Permalink
Repo File Sync: synced file(s) with microsoft/mu_devops
Browse files Browse the repository at this point in the history
Signed-off-by: Project Mu UEFI Bot <[email protected]>
  • Loading branch information
uefibot committed Sep 26, 2023
1 parent 506de63 commit cdd9daa
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 18 deletions.
7 changes: 4 additions & 3 deletions .azurepipelines/MuDevOpsWrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
type: github
endpoint: microsoft
name: microsoft/mu_devops
ref: refs/tags/v6.1.0
ref: refs/tags/v6.5.1

parameters:
- name: do_ci_build
Expand Down Expand Up @@ -83,8 +83,6 @@ jobs:
linux_container_image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:9ab29bc
${{ if eq(parameters.rust_build, true) }}:
linux_container_options: --security-opt seccomp=unconfined
extra_steps:
- template: Steps/RustSetupSteps.yml@mu_devops
do_ci_build: ${{ parameters.do_ci_build }}
do_ci_setup: ${{ parameters.do_ci_setup }}
do_pr_eval: ${{ parameters.do_pr_eval }}
Expand All @@ -97,6 +95,7 @@ jobs:
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
Expand All @@ -113,6 +112,8 @@ jobs:
clean: true
- ${{ parameters.extra_cargo_steps }}
- template: Steps/RustCargoSteps.yml@mu_devops
parameters:
container_build: true

- ${{ parameters.extra_jobs }}

2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ 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/AutoApprover.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/AutoApprover.yml@v6.5.1
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ 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/AutoMerger.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@v6.5.1
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/issue-assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ on:

jobs:
apply:
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v6.5.1
2 changes: 1 addition & 1 deletion .github/workflows/label-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ on:

jobs:
apply:
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v6.5.1
2 changes: 1 addition & 1 deletion .github/workflows/label-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ on:

jobs:
sync:
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v6.5.1
2 changes: 1 addition & 1 deletion .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ on:

jobs:
draft:
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v6.5.1
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ on:

jobs:
check:
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v6.5.1
2 changes: 1 addition & 1 deletion .github/workflows/triage-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ on:

jobs:
triage:
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v6.1.0
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v6.5.1
40 changes: 33 additions & 7 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
RUSTC_BOOTSTRAP = 1
ARCH = "X64"
TARGET_TRIPLE = { source = "${ARCH}", mapping = { "X64" = "x86_64-unknown-uefi", "IA32" = "i686-unknown-uefi", "AARCH64" = "aarch64-unknown-uefi", "LOCAL" = "${CARGO_MAKE_RUST_TARGET_TRIPLE}" }, condition = { env_not_set = [ "TARGET_TRIPLE" ] } }
PACKAGE_TARGET = {value = "-p ${CARGO_MAKE_TASK_ARGS}",condition = { env_true = [ "CARGO_MAKE_TASK_ARGS", ] } }

BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --target ${TARGET_TRIPLE} -Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem -Zunstable-options --timings=html"
TEST_FLAGS = { value = "", condition = { env_not_set = ["TEST_FLAGS"] } }
COV_FLAGS = { value = "--out Html --exclude-files **/tests/*", condition = { env_not_set = ["COV_FLAGS"] } }
COV_FLAGS = { value = "--out html --exclude-files **/tests/*", condition = { env_not_set = ["COV_FLAGS"] } }

[env.development]
RUSTC_PROFILE = "dev"
Expand All @@ -20,6 +19,28 @@ RUSTC_TARGET = "debug"
RUSTC_PROFILE = "release"
RUSTC_TARGET = "release"

[tasks.individual-package-targets]
script_runner = "@duckscript"
script = '''
args = get_env CARGO_MAKE_TASK_ARGS
if is_empty ${args}
exit
end
1 = array ""
2 = split ${args} ,
3 = array_concat ${1} ${2}
joined_args = array_join ${3} " -p "
release ${1}
release ${2}
release ${3}
joined_args = trim ${joined_args}
set_env INDIVIDUAL_PACKAGE_TARGETS ${joined_args}
release ${joined_args}
'''

[tasks.build]
description = """Builds a single rust package.
Expand All @@ -34,28 +55,33 @@ Example:
"""
clear = true
command = "cargo"
args = ["build", "@@split(PACKAGE_TARGET, )", "@@split(BUILD_FLAGS, )"]
args = ["build", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )"]
dependencies = ["individual-package-targets"]

[tasks.check]
description = "Checks rust code for errors. Example `cargo make check`"
clear = true
command = "cargo"
args = ["check", "@@split(PACKAGE_TARGET, )", "@@split(BUILD_FLAGS, )"]
args = ["check", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )"]
dependencies = ["individual-package-targets"]

[tasks.check_json]
description = "Checks rust code for errors with results in JSON. Example `cargo make check_json`"
clear = true
command = "cargo"
args = ["check", "@@split(PACKAGE_TARGET, )", "@@split(BUILD_FLAGS, )", "--message-format=json"]
args = ["check", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )", "--message-format=json"]
dependencies = ["individual-package-targets"]

[tasks.test]
description = "Builds all rust tests in the workspace. Example `cargo make test`"
clear = true
command = "cargo"
args = ["test", "@@split(PACKAGE_TARGET, )", "@@split(TEST_FLAGS, )"]
args = ["test", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(TEST_FLAGS, )"]
dependencies = ["individual-package-targets"]

[tasks.coverage]
description = "Build and run all tests and calculate coverage."
clear = true
command = "cargo"
args = ["tarpaulin", "@@split(PACKAGE_TARGET, )", "@@split(COV_FLAGS, )", "--output-dir", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target"]
args = ["tarpaulin", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(COV_FLAGS, )", "--output-dir", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target"]
dependencies = ["individual-package-targets"]

0 comments on commit cdd9daa

Please sign in to comment.