| 1 |
on: [push, pull_request] |
| 2 |
|
| 3 |
name: Continuous integration |
| 4 |
|
| 5 |
jobs: |
| 6 |
test: |
| 7 |
name: Test |
| 8 |
strategy: |
| 9 |
matrix: |
| 10 |
os: [ubuntu-latest, windows-latest] |
| 11 |
runs-on: ${{ matrix.os }} |
| 12 |
steps: |
| 13 |
- uses: actions/checkout@v2 |
| 14 |
- uses: actions/cache@v2 |
| 15 |
with: |
| 16 |
path: | |
| 17 |
~/.cargo/registry |
| 18 |
~/.cargo/git |
| 19 |
target |
| 20 |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 21 |
restore-keys: | |
| 22 |
${{ runner.os }}-cargo- |
| 23 |
${{ runner.os }}- |
| 24 |
- uses: actions-rs/toolchain@v1 |
| 25 |
with: |
| 26 |
toolchain: stable |
| 27 |
override: true |
| 28 |
- uses: actions-rs/cargo@v1 |
| 29 |
with: |
| 30 |
command: test |
| 31 |
args: --workspace --all-targets --all-features |
| 32 |
|
| 33 |
lint: |
| 34 |
name: Lint |
| 35 |
runs-on: ubuntu-latest |
| 36 |
steps: |
| 37 |
- uses: actions/checkout@v2 |
| 38 |
- uses: actions/cache@v2 |
| 39 |
with: |
| 40 |
path: | |
| 41 |
~/.cargo/registry |
| 42 |
~/.cargo/git |
| 43 |
target |
| 44 |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 45 |
restore-keys: | |
| 46 |
${{ runner.os }}-cargo- |
| 47 |
${{ runner.os }}- |
| 48 |
- uses: actions-rs/toolchain@v1 |
| 49 |
with: |
| 50 |
toolchain: stable |
| 51 |
override: true |
| 52 |
components: rustfmt |
| 53 |
- uses: actions-rs/cargo@v1 |
| 54 |
with: |
| 55 |
command: fmt |
| 56 |
args: --all -- --check |
| 57 |
- uses: actions-rs/cargo@v1 |
| 58 |
with: |
| 59 |
command: clippy |
| 60 |
args: --all -- -D warnings |