- use cargo action over run - run clippy and test on all OS - remove caches caches dont improve speed that much (about a minute better?) and might lead to side effects (happened)
85 lines
1.8 KiB
YAML
85 lines
1.8 KiB
YAML
name: Rust
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
clippy:
|
|
name: Clippy ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macOS-latest
|
|
- windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
profile: minimal
|
|
components: clippy
|
|
|
|
- name: Run clippy
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clippy
|
|
args: --verbose --all-targets --all-features -- -D clippy::all -D clippy::pedantic
|
|
|
|
rustfmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: stable
|
|
override: true
|
|
profile: minimal
|
|
components: rustfmt
|
|
|
|
- name: Check format
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: -- --check --verbose
|
|
|
|
test:
|
|
name: Test ${{ matrix.os }} ${{ matrix.toolchain }}
|
|
runs-on: ${{ matrix.os }}
|
|
needs: clippy
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macOS-latest
|
|
- windows-latest
|
|
toolchain:
|
|
- stable
|
|
- nightly
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.toolchain }}
|
|
profile: minimal
|
|
override: true
|
|
|
|
- name: Run tests
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --verbose --locked --all-features
|