1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-01-19 08:24:41 +01:00

83 lines
2.3 KiB
YAML
Raw Normal View History

2020-01-31 00:01:11 +09:00
name: CI (Linux)
2020-07-08 08:38:24 +09:00
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
- '1.0'
2020-01-31 00:01:11 +09:00
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
version:
2020-08-17 15:37:57 +01:00
- 1.42.0
2020-01-31 00:01:11 +09:00
- stable
- nightly
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-01-31 00:01:11 +09: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-28 02:32:29 +09:00
- name: Cache cargo dirs
uses: actions/cache@v2
2020-01-31 00:01:11 +09:00
with:
2020-05-28 02:32:29 +09:00
path:
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-trimmed-${{ hashFiles('**/Cargo.lock') }}
2020-01-31 00:01:11 +09:00
- name: Cache cargo build
2020-05-28 02:32:29 +09:00
uses: actions/cache@v2
2020-01-31 00:01:11 +09: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-18 05:03:37 +09:00
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
2020-01-31 00:01:11 +09:00
run: |
2020-08-05 09:02:41 +09:00
cargo install cargo-tarpaulin
2020-01-31 00:01:11 +09:00
cargo tarpaulin --out Xml --workspace --all-features
- name: Upload to Codecov
2020-03-18 05:03:37 +09:00
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
2020-01-31 00:01:11 +09:00
uses: codecov/codecov-action@v1
with:
file: cobertura.xml
- name: Clear the cargo caches
run: |
2020-08-05 09:02:41 +09:00
rustup update stable
rustup override set stable
cargo install cargo-cache --no-default-features --features ci-autoclean
2020-01-31 00:01:11 +09:00
cargo-cache