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:
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:
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
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