Skip to content

Commit 04732fd

Browse files
authored
Add RustCargoSteps workflow (#468)
Adds a Rust workflow that makes sure the code is well formatted, doesn't have Clippy errors, and that tests that are passing and validate the documentation. This workflow is synced with these repositories: - microsoft/mu_basecore - microsoft/mu_plus - microsoft/mu_rust_helpers - microsoft/mu_rust_hid - microsoft/mu_rust_pi - microsoft/mu_tiano_platforms This has been tested on a dummy repository.
1 parent c691e37 commit 04732fd

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

.sync/Files.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,12 @@ group:
712712
template: true
713713
repos: |
714714
microsoft/mu_devops
715+
microsoft/mu_feature_mm_supv
716+
microsoft/mu_plus
717+
microsoft/mu_rust_helpers
718+
microsoft/mu_rust_hid
719+
microsoft/mu_rust_pi
720+
microsoft/mu_tiano_platforms
715721
716722
# Rust - Formatting configuration
717723
- files:
@@ -722,6 +728,7 @@ group:
722728
dest: rustfmt.toml
723729
repos: |
724730
microsoft/mu_basecore
731+
microsoft/mu_feature_mm_supv
725732
microsoft/mu_plus
726733
microsoft/mu_rust_helpers
727734
microsoft/mu_rust_hid
@@ -748,3 +755,15 @@ group:
748755
microsoft/mu_rust_hid
749756
microsoft/mu_rust_pi
750757
microsoft/mu_tiano_platforms
758+
759+
# Rust - Cargo Workflow
760+
- files:
761+
- source: .sync/workflows/leaf/RustCargoSteps.yml
762+
dest: .github/workflows/RustCargoSteps.yml
763+
repos: |
764+
microsoft/mu_basecore
765+
microsoft/mu_plus
766+
microsoft/mu_rust_helpers
767+
microsoft/mu_rust_hid
768+
microsoft/mu_rust_pi
769+
microsoft/mu_tiano_platforms
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# This workflow validates the formatting of Rust code,
2+
# make sure Rust test are passing and run some validation on the Rust documentation.
3+
#
4+
# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there
5+
# instead of the file in this repo.
6+
#
7+
# - Mu DevOps Repo: https://github.com/microsoft/mu_devops
8+
# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml
9+
#
10+
# Copyright (c) Microsoft Corporation.
11+
# SPDX-License-Identifier: BSD-2-Clause-Patent
12+
#
13+
14+
name: Validate rust code.
15+
16+
on:
17+
workflow_dispatch:
18+
push:
19+
branches:
20+
- "main"
21+
- "dev/**"
22+
- "release/**"
23+
pull_request:
24+
branches:
25+
- "main"
26+
- "dev/**"
27+
- "release/**"
28+
29+
jobs:
30+
rust_ci:
31+
name: Rust CI
32+
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: ✅ Checkout Repository ✅
37+
uses: actions/checkout@v4
38+
39+
- name: 🛠️ Download Rust Tools 🛠️
40+
uses: microsoft/mu_devops/.github/actions/rust-tool-cache@main
41+
42+
- name: Run cargo fmt
43+
run: cargo make fmt
44+
env:
45+
RUSTC_BOOTSTRAP: 1
46+
47+
- name: 📎 Run cargo clippy 📎
48+
if: success() || failure()
49+
run: cargo make clippy
50+
env:
51+
RUSTC_BOOTSTRAP: 1
52+
53+
- name: 🧪 Run Tests 🧪
54+
if: success() || failure()
55+
run: cargo make test
56+
env:
57+
RUSTC_BOOTSTRAP: 1
58+
59+
- name: Run Documentation
60+
if: success() || failure()
61+
run: cargo make doc
62+
env:
63+
RUSTC_BOOTSTRAP: 1

0 commit comments

Comments
 (0)