name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Build and test all components
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
if: startsWith(matrix.os, 'windows')
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ matrix.name }}-${{ matrix.cross-target }}
- uses: actions/cache@v3
if: "!startsWith(matrix.os, 'windows')"
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.name }}-${{ matrix.cross-target }}
- name: Set up Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run the tests
run: cargo test --workspace --all-features