Skip to content

Commit

Permalink
fix(ci): Do not run coverage in merge queue (#239)
Browse files Browse the repository at this point in the history
## Overview

Changes the codecov job to not run in the merge queue.

See: matplotlib/napari-matplotlib#155
  • Loading branch information
clabby authored Jun 11, 2024
1 parent 8515dca commit d6f0ba8
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 33 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Rust Coverage
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
runs-on: ubuntu-latest
name: codecov
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo install cargo-nextest
uses: taiki-e/install-action@nextest
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov nextest --locked --workspace --lcov --output-path lcov.info
- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,RUST
files: lcov.info
33 changes: 0 additions & 33 deletions .github/workflows/rust_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,36 +96,3 @@ jobs:
run: just lint-docs
- name: doctest
run: just test-docs
coverage:
runs-on: ubuntu-latest
name: codecov
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo install cargo-nextest
uses: taiki-e/install-action@nextest
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov nextest --locked --workspace --lcov --output-path lcov.info
- name: Record Rust version
run: echo "RUST=$(rustc --version)" >> "$GITHUB_ENV"
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,RUST
files: lcov.info

0 comments on commit d6f0ba8

Please sign in to comment.