test: big lockfile (#213) #787
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run cargo-llvm-cov and upload to codecov.io | |
name: Code Coverage | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [opened, synchronize] | |
paths: | |
- '**.rs' | |
push: | |
branches: | |
- main | |
paths: | |
- '**.rs' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref_name != 'main' }} | |
jobs: | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true # Pull submodules for `cargo coverage` | |
- name: Install Rust Toolchain | |
uses: ./.github/actions/rustup | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install cargo-nextest | |
uses: taiki-e/install-action@cargo-nextest | |
- name: Install llvm-tools-preview for llvm-cov | |
run: rustup component add llvm-tools-preview | |
- name: Install pnpm (for compatibility check) | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8.9.2 | |
run_install: false | |
standalone: true | |
- name: Cache pnpm | |
uses: actions/cache@v3 | |
with: | |
key: codecov-pnpm-${{ matrix.os }} | |
path: | | |
${{ env.PNPM_HOME }}/store/v3 | |
${{ env.HOME }}/.local/share/pnpm/store/v3 | |
timeout-minutes: 1 | |
continue-on-error: true | |
- name: Install just | |
uses: taiki-e/install-action@just | |
- name: Install dependencies | |
run: just install | |
- name: Run | |
run: | | |
just registry-mock launch | |
# removing env vars is a temporary workaround for unit tests in pacquet relying on external environment | |
# this should be removed in the future | |
unset PNPM_HOME | |
unset XDG_DATA_HOME | |
cargo codecov --lcov --output-path lcov.info | |
just registry-mock end | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: codecov | |
path: lcov.info | |
# codecov often fails, use another workflow for retry | |
upload-codecov: | |
name: Upload coverage file | |
runs-on: ubuntu-latest | |
needs: coverage | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download coverage file | |
uses: actions/download-artifact@v3 | |
with: | |
name: codecov | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
files: lcov.info |