name: Tests on: [pull_request, push] jobs: test: name: Test runs-on: ${{ matrix.os }} strategy: matrix: build: [ linux-stable, macos-stable, windows-stable, ] include: - build: linux-stable os: ubuntu-latest rust: stable - build: macos-stable os: macos-latest rust: stable - build: windows-stable os: windows-latest rust: stable steps: - uses: actions/checkout@v2 - name: Cache Cargo registry uses: actions/cache@v1 with: path: ~/.cargo/registry key: ${{ matrix.build }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ matrix.build }}-cargo-registry- # HACK(@ohsayan): The next line skips caching until it is fixed if: runner.os != 'macOS' - name: Cache Cargo index uses: actions/cache@v1 with: path: ~/.cargo/git key: ${{ matrix.build }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ matrix.build }}-cargo-index- # HACK(@ohsayan): The next line skips caching until it is fixed if: runner.os != 'macOS' - name: Cache Cargo build uses: actions/cache@v1 with: path: target key: ${{ matrix.build }}-target-${{ hashFiles('**/Cargo.lock') }} restore-keys: | ${{ matrix.build }}-target- # HACK(@ohsayan): The next line skips caching until it is fixed if: runner.os != 'macOS' - name: Install Rust run: | rustup update ${{ matrix.rust }} --no-self-update rustup default ${{ matrix.rust }} - name: Run Tests run: cargo test --verbose -- --test-threads=1 env: RUST_BACKTRACE: 1