Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repo File Sync: Update to Mu DevOps v6.1.0 #230

Merged
merged 1 commit into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 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/v5.0.6
ref: refs/tags/v6.1.0

parameters:
- name: do_ci_build
Expand Down Expand Up @@ -67,11 +67,19 @@ parameters:
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

jobs:
- template: Jobs/PrGate.yml@mu_devops
parameters:
linux_container_image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:3bf70b5
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 @@ -85,5 +93,20 @@ jobs:
vm_image: $(vm_image)
container_build: ${{ parameters.container_build }}

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

container:

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

steps:
- checkout: self
fetchDepth: 1
clean: true
- template: Steps/RustCargoSteps.yml@mu_devops

- ${{ parameters.extra_jobs }}

2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"image": "ghcr.io/microsoft/mu_devops/ubuntu-22-dev:latest",
"postCreateCommand": "git config --global --add safe.directory '*' && pip install --upgrade -r pip-requirements.txt",
"postCreateCommand": "git config --global --add safe.directory '*' && git config --global --add core.autocrlf false && pip install --upgrade -r pip-requirements.txt",
"customizations": {
"vscode": {
"extensions": [
Expand Down
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/AutoApprover.yml@v6.1.0
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/AutoMerger.yml@v6.1.0
secrets: inherit
74 changes: 73 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
git config --system core.longpaths true

- name: Install/Upgrade pip Modules
run: pip install -r pip-requirements.txt --upgrade
run: pip install -r pip-requirements.txt --upgrade requests

- name: Determine CI Settings File Supported Operations
id: get_ci_file_operations
Expand Down Expand Up @@ -149,6 +149,78 @@ jobs:
print(f'ci_setup_supported={str(ci_setup_supported).lower()}', file=fh)
print(f'setup_supported={str(setup_supported).lower()}', file=fh)

- name: Get Cargo Tool Details
id: get_cargo_tool_details
shell: python
run: |
import os
import requests

GITHUB_REPO = "sagiegurari/cargo-make"
API_URL = f"https://api.github.com/repos/{GITHUB_REPO}/releases/latest"

# Default value in case getting latest fails, cache will fall
# back on this version.
latest_cargo_make_version = "0.36.13"
response = requests.get(API_URL)

if response.status_code == 200:
latest_cargo_make_version = response.json()["tag_name"]
else:
print("::error title=GitHub Release Error!::Failed to get latest cargo-make version!")

cache_key = f'cargo-make-{latest_cargo_make_version}'

with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'cargo_bin_path={os.path.join(os.environ["USERPROFILE"], ".cargo", "bin")}', file=fh)
print(f'cargo_make_cache_key={cache_key}', file=fh)
print(f'cargo_make_version={latest_cargo_make_version}', file=fh)

- name: Attempt to Load cargo-make From Cache
id: cargo_make_cache
uses: actions/cache@v3
with:
path: ${{ steps.get_cargo_tool_details.outputs.cargo_bin_path }}
key: ${{ steps.get_cargo_tool_details.outputs.cargo_make_cache_key }}

- name: Download cargo-make
if: steps.cargo_make_cache.outputs.cache-hit != 'true'
uses: robinraju/[email protected]
with:
repository: 'sagiegurari/cargo-make'
tag: '${{ steps.get_cargo_tool_details.outputs.cargo_make_version }}'
fileName: 'cargo-make-v${{ steps.get_cargo_tool_details.outputs.cargo_make_version }}-x86_64-pc-windows-msvc.zip'
out-file-path: 'cargo-make-download'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Extract cargo-make
if: steps.cargo_make_cache.outputs.cache-hit != 'true'
env:
CARGO_MAKE_VERSION: ${{ steps.get_cargo_tool_details.outputs.cargo_make_version }}
DEST_DIR: ${{steps.get_cargo_tool_details.outputs.cargo_bin_path }}
shell: python
run: |
import os
import shutil
import zipfile
from pathlib import Path

DOWNLOAD_DIR = Path(os.environ["GITHUB_WORKSPACE"], "cargo-make-download")
ZIP_FILE_NAME = f"cargo-make-v{os.environ['CARGO_MAKE_VERSION']}-x86_64-pc-windows-msvc.zip"
ZIP_FILE_PATH = Path(DOWNLOAD_DIR, ZIP_FILE_NAME)
EXTRACT_DIR = Path(DOWNLOAD_DIR, "cargo-make-contents")

with zipfile.ZipFile(ZIP_FILE_PATH, 'r') as zip_ref:
zip_ref.extractall(EXTRACT_DIR)

for extracted_file in EXTRACT_DIR.iterdir():
if extracted_file.name == "cargo-make.exe":
shutil.copy2(extracted_file, os.environ["DEST_DIR"])
break

- name: Rust Prep
run: rustup component add rust-src

- name: Setup
if: steps.get_ci_file_operations.outputs.setup_supported == 'true'
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.archs }} TOOL_CHAIN_TAG=${{ matrix.tool_chain_tag }}
Expand Down
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/IssueAssignment.yml@v6.1.0
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/Labeler.yml@v6.1.0
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/LabelSyncer.yml@v6.1.0
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/ReleaseDrafter.yml@v6.1.0
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/Stale.yml@v6.1.0
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@v5.0.6
uses: microsoft/mu_devops/.github/workflows/IssueTriager.yml@v6.1.0