Skip to content

chore: resurrect codecov reports #1830

chore: resurrect codecov reports

chore: resurrect codecov reports #1830

Workflow file for this run

name: Forest code coverage
# Cancel workflow if there is a new change to the branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
on:
workflow_dispatch:
merge_group:
pull_request:
branches:
- main
# This needs to be declared explicitly so that the job is actually
# run when moved out of draft.
types: [opened, synchronize, reopened, ready_for_review]
paths-ignore:
- "docs/**"
- ".github/workflows/docs-*.yml"
push:
branches:
- main
paths-ignore:
- "docs/**"
- ".github/workflows/docs-*.yml"
env:
CI: 1
CARGO_INCREMENTAL: 0
CACHE_TIMEOUT_MINUTES: 5
RUSTC_WRAPPER: sccache
CC: sccache clang
CXX: sccache clang++
jobs:
codecov:
name: Cover
runs-on: ubuntu-24.04
timeout-minutes: 45
# if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v6
- name: Free Disk Space
uses: endersonmenezes/free-disk-space@v3 # Use @main for latest, @v3 for stable
with:
remove_android: true
remove_dotnet: true
remove_haskell: true
remove_tool_cache: true
remove_swap: true
remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* temurin-* *llvm* mysql* dotnet-sdk-*"
remove_packages_one_command: true
remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
rm_cmd: "rm" # Use 'rmz' for faster deletion (default: 'rm')
rmz_version: "3.1.1" # Required when rm_cmd is 'rmz'
testing: false
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- uses: actions/setup-go@v6
with:
go-version-file: "go.work"
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
- name: Generate code coverage
run: |
cargo llvm-cov --workspace --codecov --output-path lcov.info nextest
env:
CC: "sccache clang"
CXX: "sccache clang++"
# To minimize compile times: https://nnethercote.github.io/perf-book/build-configuration.html#minimizing-compile-times
# RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
# Save lcov.info as an artifact for debugging purposes
- uses: actions/upload-artifact@v4
with:
name: lcov.info
path: lcov.info
if-no-files-found: error
- name: Upload CodeCov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true