]> git.lizzy.rs Git - rust.git/blobdiff - .github/workflows/ci.yaml
Merge #9646
[rust.git] / .github / workflows / ci.yaml
index 0f68b234c7850e2dccadeb8f0e780a718bcfb5a9..ee83f782f40a7eda3885ab5ebe0c1c44d3ab99f5 100644 (file)
@@ -42,14 +42,6 @@ jobs:
       if: matrix.os == 'windows-latest'
       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
 
-    # Work around https://github.com/actions/cache/issues/403 by using GNU tar
-    # instead of BSD tar.
-    - name: Install GNU tar
-      if: matrix.os == 'macos-latest'
-      run: |
-        brew install gnu-tar
-        echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
-
     - name: Install Rust toolchain
       uses: actions-rs/toolchain@v1
       with:
@@ -58,28 +50,14 @@ jobs:
         override: true
         components: rustfmt, rust-src
 
-    - name: Cache cargo directories
-      uses: actions/cache@v2
-      with:
-        path: |
-          ~/.cargo/registry
-          ~/.cargo/git
-        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
-
-    - name: Cache cargo target dir
-      uses: actions/cache@v2
-      with:
-        path: target
-        key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
+    - name: Cache Dependencies
+      uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
 
     - name: Compile
       run: cargo test --no-run --locked
 
     - name: Test
-      run: cargo test -- --nocapture
-
-    - name: Prepare cache
-      run: cargo xtask pre-cache
+      run: cargo test -- --nocapture --quiet
 
   # Weird targets to catch non-portable code
   rust-cross:
@@ -88,6 +66,9 @@ jobs:
 
     env:
       targets: "powerpc-unknown-linux-gnu x86_64-unknown-linux-musl"
+      # The rust-analyzer binary is not expected to compile on WASM, but the IDE
+      # crate should
+      targets_ide: "wasm32-unknown-unknown"
 
     steps:
     - name: Checkout repository
@@ -101,21 +82,19 @@ jobs:
         override: true
 
     - name: Install Rust targets
-      run: rustup target add ${{ env.targets }}
+      run: rustup target add ${{ env.targets }} ${{ env.targets_ide }}
 
-    - name: Cache cargo directories
-      uses: actions/cache@v2
-      with:
-        path: |
-          ~/.cargo/registry
-          ~/.cargo/git
-        key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
+    - name: Cache Dependencies
+      uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
 
     - name: Check
       run: |
         for target in ${{ env.targets }}; do
           cargo check --target=$target --all-targets
         done
+        for target in ${{ env.targets_ide }}; do
+          cargo check -p ide --target=$target --all-targets
+        done
 
   typescript:
     name: TypeScript