-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into remove-lazystatic-r…
…ust-tag
- Loading branch information
Showing
32 changed files
with
892 additions
and
856 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "Install Winget" | ||
description: "Install winget on windows runners since its not installed by default: https://github.com/actions/runner-images/issues/6472" | ||
inputs: | ||
GITHUB_TOKEN: | ||
description: 'GitHub token to execute authenticated Github API requests (for higher rate limit)' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Get URIs for Latest Winget assets | ||
shell: pwsh | ||
run: | | ||
$AuthenticatedHeaders = @{ "Authorization" = "Bearer ${{ inputs.GITHUB_TOKEN }}" } | ||
$LatestReleaseInfo = Invoke-RestMethod -Headers $AuthenticatedHeaders 'https://api.github.com/repos/microsoft/winget-cli/releases/latest' | ||
$LatestWingetDownloadUri = $LatestReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('.msixbundle') } | ||
$LatestWingetLicenseDownloadUri = $LatestReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('License1.xml') } | ||
# Print to logs | ||
Write-Host "LatestWingetDownloadUri=$LatestWingetDownloadUri" | ||
Write-Host "LatestWingetLicenseDownloadUri=$LatestWingetLicenseDownloadUri" | ||
# Save output for next step | ||
Write-Output "LatestWingetDownloadUri=$LatestWingetDownloadUri" >> $env:GITHUB_ENV | ||
Write-Output "LatestWingetLicenseDownloadUri=$LatestWingetLicenseDownloadUri" >> $env:GITHUB_ENV | ||
- name: Download Winget Assets and Dependencies | ||
shell: pwsh | ||
run: | | ||
New-Item -Type Directory $env:RUNNER_TEMP/winget-install | ||
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile $env:RUNNER_TEMP/winget-install/Microsoft.UI.Xaml.2.7.x64.appx | ||
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile $env:RUNNER_TEMP/winget-install/Microsoft.VCLibs.x64.14.00.Desktop.appx # Needed per https://github.com/microsoft/winget-cli/blob/21de1607ed5c90174e6bb931406975c18681a5dd/README.md?plain=1#L35C19-L35C19 | ||
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:LatestWingetDownloadUri -OutFile $env:RUNNER_TEMP/winget-install/winget.msixbundle | ||
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:LatestWingetLicenseDownloadUri -OutFile $env:RUNNER_TEMP/winget-install/license.xml | ||
- name: Start Winget Installation | ||
shell: pwsh | ||
run: | | ||
Add-AppxProvisionedPackage -Online -PackagePath $env:RUNNER_TEMP/winget-install/winget.msixbundle -LicensePath $env:RUNNER_TEMP/winget-install/license.xml -DependencyPackagePath $env:RUNNER_TEMP/winget-install/Microsoft.UI.Xaml.2.7.x64.appx, $env:RUNNER_TEMP/winget-install/Microsoft.VCLibs.x64.14.00.Desktop.appx | ||
- name: Wait for Completion of Winget Installation | ||
shell: pwsh | ||
run: | | ||
while ((Get-Command * | Select-String winget).ToString() -ne "winget.exe") { | ||
Start-Sleep -Seconds 1 | ||
} | ||
Write-Output "Winget Version: $(winget --version)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "cargo" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "wednesday" | ||
timezone: "America/Los_Angeles" | ||
time: "06:00" | ||
commit-message: | ||
prefix: "Cargo Dependency" | ||
labels: | ||
- "type:dependabot" | ||
- "type:dependencies-cargo" | ||
rebase-strategy: "disabled" | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
day: "wednesday" | ||
timezone: "America/Los_Angeles" | ||
time: "06:00" | ||
ignore: | ||
- dependency-name: "microsoft/mu_devops" | ||
commit-message: | ||
prefix: "GitHub Actions" | ||
labels: | ||
- "type:dependabot" | ||
- "type:dependencies-github-actions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
on: | ||
push: | ||
pull_request: | ||
schedule: # Trigger a job on default branch at 4AM PST everyday | ||
- cron: "0 11 * * *" | ||
|
||
name: Build | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
wdk: | ||
- Microsoft.WindowsWDK.10.0.22621 # NI WDK | ||
|
||
rust_toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
|
||
cargo_profile: | ||
- dev | ||
- release | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Winget | ||
uses: ./.github/actions/winget-install | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install WDK (${{ matrix.wdk }}) | ||
run: | | ||
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) { | ||
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }} | ||
} | ||
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
|
||
- name: Run Cargo Build | ||
run: cargo build --locked --profile ${{ matrix.cargo_profile }} --workspace | ||
|
||
- name: Install Cargo Make | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-make | ||
|
||
- name: Build and Package Sample KMDF Driver | ||
run: cargo make --cwd .\crates\sample-kmdf-driver --profile ${{ matrix.cargo_profile }} | ||
continue-on-error: true # FIXME: Packaging tools in non-ewdk environments are not found |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Cargo Audit | ||
on: | ||
push: | ||
paths: | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
pull_request: | ||
paths: | ||
- "**/Cargo.toml" | ||
- "**/Cargo.lock" | ||
schedule: # Trigger a job on default branch at 4AM PST everyday | ||
- cron: 0 11 * * * | ||
|
||
jobs: | ||
cargo_audit: | ||
name: Cargo Audit | ||
runs-on: windows-latest | ||
permissions: | ||
issues: write | ||
checks: write | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Cargo Audit | ||
uses: rustsec/audit-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Code Formatting Check | ||
on: | ||
push: | ||
pull_request: | ||
schedule: # Trigger a job on default branch at 4AM PST everyday | ||
- cron: 0 11 * * * | ||
|
||
|
||
jobs: | ||
cargo-fmt: | ||
name: .rs Formatting Check | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust Toolchain (Nightly) | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
components: rustfmt | ||
|
||
- name: Run Cargo Format | ||
run: cargo fmt --all -- --check | ||
|
||
taplo-fmt: | ||
name: .toml Formatting Check | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Rust Toolchain (Stable) | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Install taplo-cli | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: taplo-cli | ||
|
||
- run: taplo fmt --check --diff | ||
name: Check TOML files formatting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
on: | ||
push: | ||
pull_request: | ||
schedule: # Trigger a job on default branch at 4AM PST everyday | ||
- cron: "0 11 * * *" | ||
|
||
name: Docs | ||
|
||
jobs: | ||
docs: | ||
name: Docs | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
wdk: | ||
- Microsoft.WindowsWDK.10.0.22621 # NI WDK | ||
|
||
rust_toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
|
||
cargo_profile: | ||
- dev | ||
- release | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Winget | ||
uses: ./.github/actions/winget-install | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install WDK (${{ matrix.wdk }}) | ||
run: | | ||
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) { | ||
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }} | ||
} | ||
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
|
||
- name: Run Cargo Doc | ||
run: cargo doc --locked --profile ${{ matrix.cargo_profile }} | ||
|
||
- name: Run Cargo Doc (--features nightly) | ||
if: matrix.rust_toolchain == 'nightly' | ||
run: cargo doc --locked --profile ${{ matrix.cargo_profile }} --features nightly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Dependency Review | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
dependency-review: | ||
name: Github Dependency Review | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Dependency Review | ||
uses: actions/dependency-review-action@v3 | ||
with: | ||
allow-licenses: MIT, Apache-2.0 | ||
comment-summary-in-pr: on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
on: | ||
push: | ||
pull_request: | ||
schedule: # Trigger a job on default branch at 4AM PST everyday | ||
- cron: "0 11 * * *" | ||
|
||
name: Lint | ||
|
||
jobs: | ||
clippy: | ||
name: Clippy | ||
runs-on: windows-latest | ||
permissions: | ||
checks: write | ||
strategy: | ||
matrix: | ||
wdk: | ||
- Microsoft.WindowsWDK.10.0.22621 # NI WDK | ||
|
||
rust_toolchain: | ||
- stable | ||
- beta | ||
- nightly | ||
|
||
cargo_profile: | ||
- dev | ||
- release | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Winget | ||
uses: ./.github/actions/winget-install | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install WDK (${{ matrix.wdk }}) | ||
run: | | ||
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) { | ||
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }} | ||
} | ||
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust_toolchain }} | ||
|
||
- name: Run Cargo Clippy | ||
uses: giraffate/clippy-action@v1 | ||
with: | ||
tool_name: Clippy | ||
clippy_flags: --locked --profile ${{ matrix.cargo_profile }} --all-targets -- -D warnings | ||
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
filter_mode: nofilter | ||
fail_on_error: true | ||
|
||
- name: Run Cargo Clippy (--features nightly) | ||
if: matrix.rust_toolchain == 'nightly' | ||
uses: giraffate/clippy-action@v1 | ||
with: | ||
tool_name: Clippy (--features nightly) | ||
clippy_flags: --locked --profile ${{ matrix.cargo_profile }} --all-targets --features nightly -- -D warnings | ||
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
filter_mode: nofilter | ||
fail_on_error: true | ||
|
||
udeps: | ||
name: Detect Unused Cargo Dependencies | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
wdk: | ||
- Microsoft.WindowsWDK.10.0.22621 # NI WDK | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Winget | ||
uses: ./.github/actions/winget-install | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install WDK (${{ matrix.wdk }}) | ||
run: | | ||
if (!(winget list --exact --source winget --id ${{ matrix.wdk }})[-1].contains("${{ matrix.wdk }}")) { | ||
winget install --disable-interactivity --source winget --exact --id ${{ matrix.wdk }} | ||
} | ||
- name: Install Rust Toolchain (Nightly) | ||
uses: dtolnay/rust-toolchain@nightly | ||
# Cargo udeps only supports running on nightly due to reliance on unstable dep-info feature: https://github.com/est31/cargo-udeps/issues/113, https://github.com/est31/cargo-udeps/issues/136 | ||
|
||
- name: Install Cargo Udeps | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-udeps | ||
|
||
- name: Run Cargo Udeps | ||
run: cargo udeps --locked --all-targets | ||
|
||
- name: Run Cargo Udeps (--features nightly) | ||
run: cargo udeps --locked --all-targets --features nightly |
Oops, something went wrong.