-
Notifications
You must be signed in to change notification settings - Fork 16
76 lines (72 loc) · 2.32 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
name: Test native builds
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
os: ["ubuntu-latest", "macos-14"]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build tests
run: cargo test --verbose --no-run
- name: Run crate tests
run: cargo test --verbose --lib
- name: Run doc tests
run: cargo test --verbose --doc
test-windows:
runs-on: windows-latest
timeout-minutes: 15
steps:
- name: Create dev drive using ReFS
run: |
$Volume = New-VHD -Path C:/fidget_dev_drive.vhdx -SizeBytes 10GB |
Mount-VHD -Passthru |
Initialize-Disk -Passthru |
New-Partition -AssignDriveLetter -UseMaximumSize |
Format-Volume -FileSystem ReFS -Confirm:$false -Force
Write-Output $Volume
Write-Output "DEV_DRIVE=$($Volume.DriveLetter):" >> $env:GITHUB_ENV
- uses: actions/checkout@v4
- name: Copy repo to dev drive
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.DEV_DRIVE }}/fidget" -Recurse
- name: Select Rust toolchain
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
run: |
rustup set profile minimal
rustup default stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ env.DEV_DRIVE }}/fidget
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
- name: Build tests
working-directory: ${{ env.DEV_DRIVE }}/fidget
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
run: cargo test --verbose --no-run
- name: Run crate tests
working-directory: ${{ env.DEV_DRIVE }}/fidget
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
run: cargo test --verbose --lib
- name: Run doc tests
working-directory: ${{ env.DEV_DRIVE }}/fidget
env:
CARGO_HOME: ${{ env.DEV_DRIVE }}/.cargo
RUSTUP_HOME: ${{ env.DEV_DRIVE }}/.rustup
run: cargo test --verbose --doc