2021-06-02 14:04:49 +00:00
|
|
|
name: Continuous Integration
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
2021-06-02 14:16:59 +00:00
|
|
|
name: ${{matrix.command.name}} (${{matrix.toolchain}})
|
2021-06-02 14:04:49 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-06-02 14:15:59 +00:00
|
|
|
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: ""
|
2021-06-02 14:04:49 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: ⚡ Cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
target
|
|
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-06-02 14:15:59 +00:00
|
|
|
toolchain: ${{ matrix.toolchain }}
|
2021-06-02 14:04:49 +00:00
|
|
|
|
2021-06-02 14:15:59 +00:00
|
|
|
- name: ${{matrix.command.name}}
|
2021-06-02 14:04:49 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
2021-06-02 14:15:59 +00:00
|
|
|
command: ${{matrix.command.command}}
|
|
|
|
args: ${{matrix.command.args}}
|