feat: mv coverage to separate CI run

This commit is contained in:
Aravinth Manivannan 2022-05-11 03:51:42 +05:30
parent a684688a81
commit 21366a0b1b
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 51 additions and 12 deletions

51
.github/workflows/coverage.yml vendored Normal file
View file

@ -0,0 +1,51 @@
name: CI (Linux)
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
version:
- stable
- nightly
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
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 ${{ matrix.version }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.version }}-x86_64-unknown-linux-gnu
profile: minimal
override: true
- name: Generate coverage file
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
uses: actions-rs/tarpaulin@v0.1
with:
args: '-t 1200'
- name: Upload to Codecov
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
uses: codecov/codecov-action@v2
with:
file: cobertura.xml

View file

@ -51,18 +51,6 @@ jobs:
command: test command: test
args: --all --all-features --no-fail-fast args: --all --all-features --no-fail-fast
- name: Generate coverage file
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
uses: actions-rs/tarpaulin@v0.1
with:
args: '-t 1200'
- name: Upload to Codecov
if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request')
uses: codecov/codecov-action@v2
with:
file: cobertura.xml
- name: generate documentation - name: generate documentation
if: matrix.version == 'stable' && (github.repository == 'realaravinth/actix-web-codegen-const-routes') if: matrix.version == 'stable' && (github.repository == 'realaravinth/actix-web-codegen-const-routes')
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1