diff options
Diffstat (limited to '.github/workflows/ci.yaml')
-rw-r--r-- | .github/workflows/ci.yaml | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1d24295ec..e7e0d599e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml | |||
@@ -10,16 +10,29 @@ on: | |||
10 | jobs: | 10 | jobs: |
11 | rust: | 11 | rust: |
12 | name: Rust | 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 | env: | 17 | env: |
15 | RUSTFLAGS: -D warnings | 18 | RUSTFLAGS: -D warnings |
16 | CARGO_INCREMENTAL: 0 | 19 | CARGO_INCREMENTAL: 0 |
17 | RUN_SLOW_TESTS: 1 | 20 | RUN_SLOW_TESTS: 1 |
21 | RUSTUP_MAX_RETRIES: 10 | ||
22 | CARGO_NET_RETRY: 10 | ||
18 | steps: | 23 | steps: |
19 | 24 | ||
20 | - name: Checkout repository | 25 | - name: Checkout repository |
21 | uses: actions/checkout@v1 | 26 | uses: actions/checkout@v1 |
22 | 27 | ||
28 | # We need to disable the existing toolchain to avoid updating rust-docs | ||
29 | # which takes a long time. The fastest way to do this is to rename the | ||
30 | # existing folder, as deleting it takes about as much time as not doing | ||
31 | # anything and just updating rust-docs. | ||
32 | - name: Rename existing rust toolchain (Windows) | ||
33 | if: matrix.os == 'windows-latest' | ||
34 | 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 | ||
35 | |||
23 | - name: Install Rust toolchain | 36 | - name: Install Rust toolchain |
24 | uses: actions-rs/toolchain@v1 | 37 | uses: actions-rs/toolchain@v1 |
25 | with: | 38 | with: |
@@ -28,7 +41,19 @@ jobs: | |||
28 | override: true | 41 | override: true |
29 | components: rustfmt, rust-src | 42 | components: rustfmt, rust-src |
30 | 43 | ||
31 | - name: Cargo target cache | 44 | - name: Cache cargo registry |
45 | uses: actions/cache@v1 | ||
46 | with: | ||
47 | path: ~/.cargo/registry | ||
48 | key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
49 | |||
50 | - name: Cache cargo index | ||
51 | uses: actions/cache@v1 | ||
52 | with: | ||
53 | path: ~/.cargo/git | ||
54 | key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
55 | |||
56 | - name: Cache cargo target dir | ||
32 | uses: actions/cache@v1 | 57 | uses: actions/cache@v1 |
33 | with: | 58 | with: |
34 | path: target | 59 | path: target |
@@ -45,12 +70,13 @@ jobs: | |||
45 | with: | 70 | with: |
46 | command: test | 71 | command: test |
47 | 72 | ||
48 | - name: Prepare build directory for cache | 73 | - name: Prepare cache |
49 | run: | | 74 | run: cargo xtask pre-cache |
50 | find ./target/debug -maxdepth 1 -type f -delete \ | 75 | |
51 | && rm -fr ./target/debug/{deps,.fingerprint}/{*ra_*,*heavy_test*,*gen_lsp*,*thread_worker*} \ | 76 | - name: Prepare cache 2 |
52 | && rm -f ./target/.rustc_info.json \ | 77 | if: matrix.os == 'windows-latest' |
53 | && rm ./target/.slow_tests_cookie | 78 | run: Remove-Item ./target/debug/xtask.exe |
79 | |||
54 | 80 | ||
55 | type-script: | 81 | type-script: |
56 | name: TypeScript | 82 | name: TypeScript |