2021-06-02 14:04:49 +00:00
|
|
|
name: Continuous Integration
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
2021-06-02 15:00:50 +00:00
|
|
|
build_test_format_lint:
|
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:43:37 +00:00
|
|
|
toolchain: [stable, beta, nightly, 1.42.0]
|
2021-06-02 14:15:59 +00:00
|
|
|
command:
|
|
|
|
- name: Check
|
|
|
|
command: check
|
2021-06-02 15:17:05 +00:00
|
|
|
args: --all-features
|
2021-06-02 14:29:30 +00:00
|
|
|
components: ""
|
2021-06-02 14:15:59 +00:00
|
|
|
- name: Test
|
|
|
|
command: test
|
2021-06-02 15:17:05 +00:00
|
|
|
args: --all-features
|
2021-06-02 14:29:30 +00:00
|
|
|
components: ""
|
2021-06-02 14:21:55 +00:00
|
|
|
include:
|
|
|
|
- toolchain: nightly
|
|
|
|
command:
|
|
|
|
name: Format
|
|
|
|
command: fmt
|
2021-06-02 15:20:25 +00:00
|
|
|
args: --all -- --check
|
2021-06-02 14:29:30 +00:00
|
|
|
components: rustfmt
|
2021-06-22 08:38:12 +00:00
|
|
|
- toolchain: nightly
|
2021-06-02 14:30:43 +00:00
|
|
|
command:
|
|
|
|
name: Lint
|
|
|
|
command: clippy
|
2021-06-22 08:38:12 +00:00
|
|
|
args: --all-features --tests --benches
|
2021-06-02 14:30:43 +00:00
|
|
|
components: clippy
|
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') }}
|
|
|
|
|
2021-06-02 15:00:50 +00:00
|
|
|
- name: Install toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
2021-06-02 14:04:49 +00:00
|
|
|
with:
|
2021-06-02 14:15:59 +00:00
|
|
|
toolchain: ${{ matrix.toolchain }}
|
2021-06-02 14:21:55 +00:00
|
|
|
override: true
|
|
|
|
default: true
|
2021-06-02 14:29:30 +00:00
|
|
|
components: ${{matrix.command.components}}
|
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}}
|
2021-06-02 15:00:50 +00:00
|
|
|
args: ${{matrix.command.args}}
|
|
|
|
|
|
|
|
coveralls_io:
|
|
|
|
name: Coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
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') }}
|
|
|
|
|
|
|
|
- name: Install toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
default: true
|
|
|
|
|
|
|
|
- name: Install cargo-tarpaulin
|
|
|
|
uses: actions-rs/install@v0.1
|
|
|
|
with:
|
|
|
|
crate: cargo-tarpaulin
|
|
|
|
version: latest
|
|
|
|
use-tool-cache: true
|
|
|
|
|
|
|
|
- name: Coverage Report with tarpaulin
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: tarpaulin
|
2021-06-02 15:10:09 +00:00
|
|
|
args: --all --all-features --out Lcov -- --test-threads 1
|
2021-06-02 15:00:50 +00:00
|
|
|
|
|
|
|
- name: Upload Coverage
|
|
|
|
uses: coverallsapp/github-action@master
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
path-to-lcov: ./lcov.info
|