1010jobs :
1111 rust :
1212 name : Rust
13- runs-on : ubuntu-latest
13+ runs-on : ${{ matrix.os }}
14+ strategy :
15+ matrix :
16+ os : [ubuntu-latest, windows-latest, macos-latest]
1417 env :
1518 RUSTFLAGS : -D warnings
1619 CARGO_INCREMENTAL : 0
2023 - name : Checkout repository
2124 uses : actions/checkout@v1
2225
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+
2334 - name : Install Rust toolchain
2435 uses : actions-rs/toolchain@v1
2536 with :
@@ -45,13 +56,29 @@ jobs:
4556 with :
4657 command : test
4758
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'
4961 run : |
5062 find ./target/debug -maxdepth 1 -type f -delete \
5163 && rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} \
5264 && rm -f ./target/.rustc_info.json \
5365 && rm ./target/.slow_tests_cookie
5466
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+
5582 type-script :
5683 name : TypeScript
5784 runs-on : ubuntu-latest
0 commit comments