-
Notifications
You must be signed in to change notification settings - Fork 323
334 lines (325 loc) · 9.89 KB
/
test.yml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
name: test
on:
push:
tags: ["v*"]
branches: ["main", "mise"]
pull_request:
branches: ["main"]
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
MISE_TRUSTED_CONFIG_PATHS: ${{ github.workspace }}
MISE_EXPERIMENTAL: 1
MISE_LOCKFILE: 1
RUST_BACKTRACE: 1
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=mold
permissions:
pull-requests: write
jobs:
build-ubuntu:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: build
- run: |
cargo build --all-features
echo "$PWD/target/debug" >> "$GITHUB_PATH"
- run: mise -v
- name: check for mold linker
run: readelf -p .comment target/debug/mise
- uses: actions/upload-artifact@v4
with:
name: mise-ubuntu-latest
path: target/debug/mise
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- run: mise i
build-macos:
runs-on: macos-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: build
- run: |
cargo build --all-features
echo "$PWD/target/debug" >> "$GITHUB_PATH"
- run: mise -v
- uses: actions/upload-artifact@v4
with:
name: mise-macos-latest
path: target/debug/mise
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise i
- run: mise x -- wait-for-gh-rate-limit
build-windows:
runs-on: windows-latest
timeout-minutes: 60
env:
MISE_DATA_DIR: ~/.local/share/mise
MISE_CACHE_DIR: ~/.cache/mise
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: Swatinem/rust-cache@v2
with:
shared-key: build
- shell: pwsh
run: |
cargo build
Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\target\debug"
- run: mise -v
- uses: actions/upload-artifact@v4
with:
name: mise-windows-latest
path: target/debug/mise.exe
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- run: mise i
unit:
strategy:
fail-fast: false
# matrix: { os: [ubuntu-latest, macos-latest] }
matrix: { os: [macos-latest] }
runs-on: ${{ matrix.os }}
timeout-minutes: 20
permissions:
contents: write
needs: [build-ubuntu, build-macos]
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
submodules: true
- uses: rui314/setup-mold@v1
if: ${{ matrix.os == 'ubuntu-latest' }}
- uses: taiki-e/install-action@v2
with:
tool: cargo-deny,cargo-msrv,cargo-machete
- run: rustup component add llvm-tools-preview
- uses: Swatinem/rust-cache@v2
with:
shared-key: unit
- uses: actions/download-artifact@v4
with:
name: mise-${{ matrix.os }}
path: target/debug
- run: echo "$PWD/target/debug" >> "$GITHUB_PATH" && chmod +x target/debug/mise
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- run: mise install
- run: mise x -- bun i
- run: mise x -- cargo test --all-features
- run: cargo deny check
- run: cargo msrv verify
- run: cargo machete --with-metadata
- run: ./scripts/test-standalone.sh
- run: mise run lint
nightly:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: rui314/setup-mold@v1
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}
- run: rustup default nightly
- uses: Swatinem/rust-cache@v2
with:
shared-key: nightly
- run: |
cargo build --all-features
echo "$PWD/target/debug" >> "$GITHUB_PATH"
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- run: mise install
- run: mise run test:shuffle
coverage:
name: coverage-${{matrix.tranche}}
runs-on: ubuntu-latest
needs: [build-ubuntu]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
tranche: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build and test dependencies
run: |
sudo apt-get install \
bison \
build-essential \
direnv \
fd-find \
fish \
pipx \
python3-venv \
zsh
- run: |
mkdir -p "$HOME/.local/bin"
ln -s "$(which fdfind)" "$HOME/.local/bin/fd"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- uses: actions/download-artifact@v4
with:
name: mise-ubuntu-latest
path: target/debug
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: echo "$PWD/target/debug" >> "$GITHUB_PATH" && chmod +x target/debug/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- name: Test w/ coverage
uses: nick-fields/retry@v3
env:
TEST_TRANCHE: ${{matrix.tranche}}
TEST_TRANCHE_COUNT: 8
TEST_ALL: ${{github.head_ref == 'release' && '1' || '0'}}
with:
timeout_minutes: 30
retry_wait_seconds: 30
max_attempts: 2
command: mise run test:coverage
windows-unit:
runs-on: windows-latest
timeout-minutes: 30
env:
MISE_DATA_DIR: ~/.local/share/mise
MISE_CACHE_DIR: ~/.cache/mise
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
shared-key: unit
- name: cargo test
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
retry_wait_seconds: 30
max_attempts: 2
command: cargo test
windows-e2e:
runs-on: windows-latest
timeout-minutes: 30
needs: [build-windows]
env:
MISE_DATA_DIR: ~/.local/share/mise
MISE_CACHE_DIR: ~/.cache/mise
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: mise-windows-latest
path: target/debug
- run: ls target\debug
- run: Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\target\debug"
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- run: mise install
- name: e2e
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
retry_wait_seconds: 30
max_attempts: 2
command: pwsh e2e-win\run.ps1
# disabled until I can get gh rate limits under control
# tools:
# strategy:
# fail-fast: false
# matrix:
# os: [windows-latest, macos-latest]
# tranche: [0, 1, 2, 3]
# needs: [build-macos, build-windows]
# runs-on: ${{ matrix.os }}
# timeout-minutes: 20
# if: github.head_ref == 'release'
# env:
# TEST_TRANCHE: ${{matrix.tranche}}
# TEST_TRANCHE_COUNT: 4
# TEST_ALL: ${{github.head_ref == 'release' && '1' || '0'}}
# MISE_DATA_DIR: ~/.local/share/mise
# MISE_CACHE_DIR: ~/.cache/mise
# MISE_DISABLE_TOOLS: |
# 1password-cli,
# adr-tools
# steps:
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# name: mise-${{ matrix.os }}
# path: target/debug
# - if: ${{ matrix.os != 'windows-latest' }}
# run: echo "$PWD/target/debug" >> "$GITHUB_PATH" && chmod +x target/debug/mise
# - if: ${{ matrix.os == 'windows-latest' }}
# shell: pwsh
# run: Add-Content $env:GITHUB_PATH "$env:GITHUB_WORKSPACE\target\debug"
# - uses: actions/cache/restore@v4
# with:
# key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
# path: |
# ~/.local/share/mise
# ~/.cache/mise
# - run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
# - run: mise install
# - uses: nick-fields/retry@v3
# with:
# timeout_minutes: 30
# retry_wait_seconds: 30
# max_attempts: 2
# command: mise test-tool --all
# env:
# MISE_USE_VERSIONS_HOST: 0