CARGO_NET_RETRY: 10
CI: 1
RUST_BACKTRACE: short
- RUSTFLAGS: -D warnings
+ RUSTFLAGS: "-D warnings -W unreachable-pub -W rust-2021-compatibility"
RUSTUP_MAX_RETRIES: 10
jobs:
- # rust-audit:
- # name: Audit Rust vulnerabilities
- # runs-on: ubuntu-latest
- # steps:
- # - name: Checkout repository
- # uses: actions/checkout@v2
-
- # - uses: actions-rs/install@v0.1
- # with:
- # crate: cargo-audit
- # use-tool-cache: true
-
- # - run: cargo audit
-
rust:
name: Rust
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 20
# We need to disable the existing toolchain to avoid updating rust-docs
# which takes a long time. The fastest way to do this is to rename the
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
-
- - name: Prepare cache
- run: cargo xtask pre-cache
-
- - name: Prepare cache 2
- if: matrix.os == 'windows-latest'
- run: Remove-Item ./target/debug/xtask.exe, ./target/debug/deps/xtask.exe
+ 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
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest, windows-latest, macos-latest]
+ os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}