diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e0d1271..27ca182 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -9,39 +9,67 @@ on: - master jobs: - test: + check: + name: Check runs-on: ubuntu-latest timeout-minutes: 5 strategy: fail-fast: true matrix: - rustup: - - toolchain: stable - components: "clippy, rustfmt" - - toolchain: nightly - components: "" - - toolchain: 1.40.0 - components: "" + rustc: [1.40.0, stable] # MSVR and current stable rustc + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rustc }} + override: true + - uses: actions-rs/cargo@v1 + with: + command: check + + test: + name: Test Suite + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 - name: Install Rust with: - toolchain: ${{ matrix.rustup.toolchain }} profile: minimal - components: ${{ matrix.rustup.components }} - default: true - - name: Clippy - run: cargo clippy - if: contains(matrix.rustup.components, 'clippy') - - name: Format - run: cargo fmt -- --check - if: contains(matrix.rustup.components, 'rustfmt') - - name: Test - run: cargo test - - name: Test (No features) - run: cargo test --no-default-features - if: matrix.rustup.toolchain == 'nightly' - - name: Benchmark - run: cargo bench - if: matrix.rustup.toolchain == 'nightly' \ No newline at end of file + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - name: Run cargo clippy + uses: actions-rs/clippy-check@v1 + with: + args: --all-features