-
Notifications
You must be signed in to change notification settings - Fork 126
125 lines (105 loc) · 4.35 KB
/
test.yaml
File metadata and controls
125 lines (105 loc) · 4.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
on:
push:
branches-ignore:
- 'gh-readonly-queue/**'
pull_request:
merge_group:
schedule: # Trigger a job on default branch at 4AM PST everyday
- cron: 0 11 * * *
name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.event.compare || github.head_ref || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: Test
strategy:
fail-fast: false # Allow all matrix variants to complete even if some fail
matrix:
runner:
- name: windows-2025
arch: amd64
- name: windows-11-arm
arch: arm64
wdk:
- version: 10.0.22621 # NI WDK
source: winget
- version: 10.0.26100 # GE WDK
source: nuget
llvm:
- 17.0.6
rust_toolchain:
- stable
- beta
- nightly
cargo_profile:
- dev
- release
runs-on: ${{ matrix.runner.name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Install Winget
uses: ./.github/actions/install-winget
with:
# windows-11-arm runner image does not include winget-cli (see https://github.com/actions/partner-runner-images/issues/95).
force-cli-install: ${{ matrix.runner.name == 'windows-11-arm' && 'true' || 'false' }}
- name: Install LLVM ${{ matrix.llvm }}
uses: ./.github/actions/install-llvm
with:
version: ${{ matrix.llvm }}
- name: Install WDK (${{ matrix.wdk.version }})
uses: ./.github/actions/install-wdk
with:
version: ${{ matrix.wdk.version }}
source: ${{ matrix.wdk.source }}
host: ${{ matrix.wdk.source == 'nuget' && matrix.runner.arch || '' }}
target: ${{ matrix.wdk.source == 'nuget' && matrix.runner.arch || '' }}
- name: Install Rust Toolchain (${{ matrix.rust_toolchain }}) and LLVM tools
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: |
x86_64-pc-windows-msvc
aarch64-pc-windows-msvc
components: llvm-tools-preview
- name: Install cargo-llvm-cov
if: matrix.runner.arch != 'arm64'
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-llvm-cov
- name: Install Cargo Expand
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-expand@1.0.85
- name: Install Cargo Make
uses: ./.github/actions/install-cargo-tool
with:
tool: cargo-make
# Code coverage is generated only for amd64 because cargo-llvm-cov
# does not currently support Windows on arm64.
# See issue: https://github.com/taiki-e/cargo-llvm-cov/issues/436
- name: Run Cargo Test with Coverage (workspace)
if: matrix.runner.arch != 'arm64'
env:
# cargo-wdk new tests try to build newly generated
# driver projects which can fail in release-plz PRs
# because the dependencies are not yet published.
# This env var skips such builds for release-plz PRs
SKIP_BUILD_IN_CARGO_WDK_NEW_TESTS: ${{ startsWith(github.head_ref, 'release-plz-') && '1' || '' }}
run: cargo +${{ matrix.rust_toolchain }} llvm-cov --workspace --codecov --output-path target/codecov.info --locked --profile ${{ matrix.cargo_profile }} --all-features
- name: Upload Coverage to Codecov
if: matrix.runner.arch != 'arm64' && github.repository == 'microsoft/windows-drivers-rs' # Skip for forks because they may not have CODECOV_TOKEN
uses: codecov/codecov-action@v5
with:
files: target/codecov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- name: Run Cargo Test (workspace)
if: matrix.runner.arch == 'arm64'
env:
# Skips build in cargo-wdk new tests for release-plz PRs
SKIP_BUILD_IN_CARGO_WDK_NEW_TESTS: ${{ startsWith(github.head_ref, 'release-plz-') && '1' || '' }}
run: cargo +${{ matrix.rust_toolchain }} test --locked --profile ${{ matrix.cargo_profile }} --all-features
- name: Run Cargo Test (Top-Level tests Folder via Cargo Make)
run: cargo +${{ matrix.rust_toolchain }} make --cwd ./tests test --locked --profile ${{ matrix.cargo_profile }}