2020-01-30 16:01:11 +01:00
|
|
|
name: CI (Linux)
|
|
|
|
|
2020-07-08 01:38:24 +02:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- '1.0'
|
2020-01-30 16:01:11 +01:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
version:
|
2020-08-17 16:37:57 +02:00
|
|
|
- 1.42.0
|
2020-01-30 16:01:11 +01:00
|
|
|
- stable
|
|
|
|
- nightly
|
|
|
|
|
|
|
|
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2020-07-29 01:47:32 +02:00
|
|
|
- uses: actions/checkout@v2
|
2020-01-30 16:01:11 +01:00
|
|
|
|
|
|
|
- name: Install ${{ matrix.version }}
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Generate Cargo.lock
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: generate-lockfile
|
2020-05-27 19:32:29 +02:00
|
|
|
- name: Cache cargo dirs
|
|
|
|
uses: actions/cache@v2
|
2020-01-30 16:01:11 +01:00
|
|
|
with:
|
2020-05-27 19:32:29 +02:00
|
|
|
path:
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
|
|
|
~/.cargo/bin
|
|
|
|
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
2020-01-30 16:01:11 +01:00
|
|
|
- name: Cache cargo build
|
2020-05-27 19:32:29 +02:00
|
|
|
uses: actions/cache@v2
|
2020-01-30 16:01:11 +01:00
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
|
|
|
|
- name: check build
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: check
|
|
|
|
args: --all --bins --examples --tests
|
|
|
|
|
|
|
|
- name: tests
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
timeout-minutes: 40
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
args: --all --all-features --no-fail-fast -- --nocapture
|
|
|
|
|
|
|
|
- name: Generate coverage file
|
2020-03-17 21:03:37 +01:00
|
|
|
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
2020-01-30 16:01:11 +01:00
|
|
|
run: |
|
2020-08-05 02:02:41 +02:00
|
|
|
cargo install cargo-tarpaulin
|
2020-01-30 16:01:11 +01:00
|
|
|
cargo tarpaulin --out Xml --workspace --all-features
|
|
|
|
|
|
|
|
- name: Upload to Codecov
|
2020-03-17 21:03:37 +01:00
|
|
|
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
|
2020-01-30 16:01:11 +01:00
|
|
|
uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
file: cobertura.xml
|
|
|
|
|
|
|
|
- name: Clear the cargo caches
|
|
|
|
run: |
|
2020-08-05 02:02:41 +02:00
|
|
|
rustup update stable
|
|
|
|
rustup override set stable
|
|
|
|
cargo install cargo-cache --no-default-features --features ci-autoclean
|
2020-01-30 16:01:11 +01:00
|
|
|
cargo-cache
|