Fix CI fmt command and make more use of test matrix.

This commit is contained in:
Sebastian Schmidt 2021-06-02 17:15:59 +03:00
parent 0e3fbc17d4
commit efdaa2f1c3

View File

@ -4,13 +4,26 @@ on: [push, pull_request]
jobs: jobs:
build_and_test: build_and_test:
name: Build, Test, Format & Lint name: ${{matrix.command.name}} ${{matrix.toolchain}}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
rust: [stable, beta, nightly, 1.24.0] toolchain: [stable, beta, nightly, 1.24.0]
command:
- name: Check
command: check
args: ""
- name: Test
command: test
args: ""
- name: Format
command: fmt
args: -- --check
- name: Lint
command: clippy
args: ""
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -25,25 +38,10 @@ jobs:
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
toolchain: ${{ matrix.rust }} toolchain: ${{ matrix.toolchain }}
- name: 🔨 Build - name: ${{matrix.command.name}}
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: build command: ${{matrix.command.command}}
args: ${{matrix.command.args}}
- name: 🔎 Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --check
- name: Lint
uses: actions-rs/cargo@v1
with:
command: clippy