Skip to content

fix(test): speed up test-release and codecov on CI #2074

fix(test): speed up test-release and codecov on CI

fix(test): speed up test-release and codecov on CI #2074

Workflow file for this run

name: 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
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
RUSTC_WRAPPER: sccache
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"
FOREST_F3_SIDECAR_FFI_BUILD_OPT_OUT: 1
FIL_PROOFS_PARAMETER_CACHE: /var/tmp/filecoin-proof-parameters
RUST_LOG: warn
jobs:
codecov:
name: Coverage
if: github.event.pull_request.draft == false && github.actor != 'dependabot[bot]'
runs-on: buildjet-4vcpu-ubuntu-2204
timeout-minutes: 45
steps:
- name: Configure SCCache variables
run: |
# External PRs do not have access to 'vars' or 'secrets'.
if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then
echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV
echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV
echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v6
- name: Setup sccache
uses: mozilla-actions/[email protected]
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: Fetch proof params and RPC test snapshots
run: |
cargo run --bin forest-dev --no-default-features --profile quick -- fetch-rpc-tests
ls -ahl $FIL_PROOFS_PARAMETER_CACHE
- name: Generate code coverage
run: make codecov
# Save lcov.info as an artifact for debugging purposes
- uses: actions/upload-artifact@v6
with:
name: lcov.info
path: lcov.info
if-no-files-found: error
- name: Upload CodeCov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: true