1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 07:02:59 +01:00
actix-net/.github/workflows/linux.yml

81 lines
2.2 KiB
YAML
Raw Normal View History

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:
- 1.39.0
- stable
- nightly
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- 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-05-27 19:32:29 +02:00
which cargo-tarpaulin || 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-05-27 19:32:29 +02:00
which cargo-cache || cargo install cargo-cache --no-default-features --features ci-autoclean
2020-01-30 16:01:11 +01:00
cargo-cache