ci: upload test coverage on codecov.io
This commit is contained in:
50
.github/workflows/check.yaml
vendored
50
.github/workflows/check.yaml
vendored
@@ -60,6 +60,7 @@ jobs:
|
||||
command: fetch
|
||||
args: --locked
|
||||
|
||||
|
||||
lsif:
|
||||
name: Generate LSIF index and upload it to Sourcegraph
|
||||
needs: [fetch]
|
||||
@@ -71,7 +72,6 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install toolchain
|
||||
id: toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly
|
||||
@@ -104,6 +104,7 @@ jobs:
|
||||
run: |
|
||||
src lsif upload -file=./dump.lsif -indexer=rust-analyzer -repo="github.com/${GITHUB_REPOSITORY}" -commit="${GITHUB_SHA}" -github-token="${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
|
||||
rustfmt:
|
||||
name: Check style
|
||||
needs: [fetch]
|
||||
@@ -241,6 +242,53 @@ jobs:
|
||||
command: test
|
||||
args: --offline
|
||||
|
||||
|
||||
coverage:
|
||||
name: Code coverage
|
||||
needs: [rustfmt, clippy, fetch]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install toolchain
|
||||
id: toolchain
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
target: x86_64-unknown-linux-musl
|
||||
override: true
|
||||
|
||||
- name: Setup Cargo cache
|
||||
uses: actions/cache@v2.1.6
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry/index
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git/db
|
||||
key: ${{ runner.os }}-cargo-deps-msrv-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Setup build cache
|
||||
uses: actions/cache@v2.1.6
|
||||
with:
|
||||
path: |
|
||||
target
|
||||
key: ${{ runner.os }}-cargo-coverage-${{ steps.toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cargo-coverage-${{ steps.toolchain.outputs.rustc_hash }}-
|
||||
${{ runner.os }}-cargo-coverage-
|
||||
|
||||
- name: Run cargo tarpaulin
|
||||
uses: actions-rs/tarpaulin@v0.1
|
||||
with:
|
||||
version: '0.18.2'
|
||||
args: '--avoid-cfg-tarpaulin'
|
||||
|
||||
- name: Upload to codecov.io
|
||||
uses: codecov/codecov-action@v2
|
||||
|
||||
|
||||
build-image:
|
||||
name: Build and push Docker image
|
||||
needs: [rustfmt, clippy]
|
||||
|
||||
Reference in New Issue
Block a user