10
10
jobs :
11
11
rust :
12
12
name : Rust
13
- runs-on : ubuntu-latest
13
+ runs-on : ${{ matrix.os }}
14
+ strategy :
15
+ matrix :
16
+ os : [ubuntu-latest, windows-latest, macos-latest]
14
17
env :
15
18
RUSTFLAGS : -D warnings
16
19
CARGO_INCREMENTAL : 0
20
23
- name : Checkout repository
21
24
uses : actions/checkout@v1
22
25
26
+ # We need to disable the existing toolchain to avoid updating rust-docs
27
+ # which takes a long time. The fastest way to do this is to rename the
28
+ # existing folder, as deleting it takes about as much time as not doing
29
+ # anything and just updating rust-docs.
30
+ - name : Rename existing rust toolchain (Windows)
31
+ if : matrix.os == 'windows-latest'
32
+ run : Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
33
+
23
34
- name : Install Rust toolchain
24
35
uses : actions-rs/toolchain@v1
25
36
with :
@@ -45,13 +56,29 @@ jobs:
45
56
with :
46
57
command : test
47
58
48
- - name : Prepare build directory for cache
59
+ - name : Prepare build directory for cache (UNIX)
60
+ if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
49
61
run : |
50
62
find ./target/debug -maxdepth 1 -type f -delete \
51
63
&& rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} \
52
64
&& rm -f ./target/.rustc_info.json \
53
65
&& rm ./target/.slow_tests_cookie
54
66
67
+ - name : Prepare build directory for cache (Windows)
68
+ if : matrix.os == 'windows-latest'
69
+ run : >-
70
+ (Get-ChildItem ./target/debug -Recurse -Depth 1 -File | Remove-Item) -and
71
+ (Remove-Item -Force -Recurse ./target/debug/deps/*ra_*) -and
72
+ (Remove-Item -Force -Recurse ./target/debug/deps/*heavy_test*) -and
73
+ (Remove-Item -Force -Recurse ./target/debug/deps/*gen_lsp*) -and
74
+ (Remove-Item -Force -Recurse ./target/debug/deps/*thread_worker*) -and
75
+ (Remove-Item -Force -Recurse ./target/debug/.fingerprint/*ra_*) -and
76
+ (Remove-Item -Force -Recurse ./target/debug/.fingerprint/*heavy_test*) -and
77
+ (Remove-Item -Force -Recurse ./target/debug/.fingerprint/*gen_lsp*) -and
78
+ (Remove-Item -Force -Recurse ./target/debug/.fingerprint/*thread_worker*) -and
79
+ (Remove-Item -Force ./target/.rustc_info.json) -and
80
+ (Remove-Item ./target/.slow_tests_cookie)
81
+
55
82
type-script :
56
83
name : TypeScript
57
84
runs-on : ubuntu-latest
0 commit comments