-
Notifications
You must be signed in to change notification settings - Fork 61
177 lines (172 loc) · 5.15 KB
/
rust.yml
File metadata and controls
177 lines (172 loc) · 5.15 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
name: Rust
on:
push:
branches: [ "main", "release/*" ]
pull_request:
branches: [ "main", "release/*" ]
paths-ignore:
- "docs/**"
- "*.md"
- ".vscode/*.json"
- ".github/ISSUE_TEMPLATE/**"
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: pwsh
jobs:
docs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{matrix.platform}}
steps:
- uses: actions/checkout@v5
- name: Add WinGet links to PATH
if: matrix.platform == 'windows-latest'
run: |
"$env:LOCALAPPDATA\\Microsoft\\WinGet\\Links" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_PATH
- name: Install prerequisites
run: ./build.ps1 -SkipBuild -Clippy -Verbose
- name: Generate documentation
run: ./build.ps1 -RustDocs -Verbose
- name: Test documentation
run: |-
$testParams = @{
SkipBuild = $true
RustDocs = $true
Test = $true
ExcludeRustTests = $true
ExcludePesterTests = $true
Verbose = $true
}
./build.ps1 @testParams
linux-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install prerequisites
run: ./build.ps1 -SkipBuild -Clippy -Verbose
- name: Build
run: ./build.ps1 -Clippy -Verbose
- name: Run rust tests
run: ./build.ps1 -SkipBuild -Test -ExcludePesterTests -Verbose
- name: Prepare build artifact
run: tar -cvf bin.tar bin/
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: linux-bin
path: bin.tar
linux-pester:
needs: linux-build
strategy:
fail-fast: false
matrix:
group: [dsc, adapters, extensions, resources]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: linux-bin
- name: Expand build artifact
run: tar -xvf bin.tar
- name: Test ${{matrix.group}}
run: |-
$params = @{
SkipBuild = $true
Test = $true
ExcludeRustTests = $true
Verbose = $true
}
./build.ps1 @params -PesterTestGroup ${{matrix.group}}
macos-build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Install prerequisites
run: ./build.ps1 -SkipBuild -Clippy -Verbose
- name: Build
run: ./build.ps1 -Clippy -Verbose
- name: Run rust tests
run: ./build.ps1 -SkipBuild -Test -ExcludePesterTests -Verbose
- name: Prepare build artifact
run: tar -cvf bin.tar bin/
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: macos-bin
path: bin.tar
macos-pester:
needs: macos-build
strategy:
fail-fast: false
matrix:
group: [dsc, adapters, extensions, resources]
runs-on: macos-latest
steps:
- uses: actions/checkout@v5
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: macos-bin
- name: Expand build artifact
run: tar -xvf bin.tar
- name: Test ${{matrix.group}}
run: |-
$params = @{
SkipBuild = $true
Test = $true
ExcludeRustTests = $true
Verbose = $true
}
./build.ps1 @params -PesterTestGroup ${{matrix.group}}
# Windows
windows-build:
runs-on: windows-latest
steps:
- name: Add WinGet links to PATH
run: |
"$env:LOCALAPPDATA\\Microsoft\\WinGet\\Links" | Out-File -Append -Encoding utf8 -FilePath $env:GITHUB_PATH
- uses: actions/checkout@v5
- name: Install prerequisites
run: ./build.ps1 -SkipBuild -Clippy -Verbose
- name: Build
run: ./build.ps1 -Clippy -Verbose
- name: Run rust tests
run: ./build.ps1 -SkipBuild -Test -ExcludePesterTests -Verbose
- name: List bin folder files
run: Get-ChildItem bin
- name: Prepare build artifact
run: tar -cvf bin.tar bin
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: windows-bin
path: bin.tar
windows-pester:
needs: windows-build
strategy:
fail-fast: false
matrix:
group: [dsc, adapters, extensions, resources]
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: windows-bin
- name: Expand build artifact
run: tar -xvf bin.tar
- name: Test ${{matrix.group}}
run: |-
$params = @{
SkipBuild = $true
Test = $true
ExcludeRustTests = $true
Verbose = $true
}
./build.ps1 @params -PesterTestGroup ${{matrix.group}}