Files
oxc-project__oxc/.github/workflows/codecov.yml
camc314 6f22859717 chore(deps): update setup-node to v1.4.1 (#26296)
## Summary

- update `oxc-project/setup-node` from v1.4.0 to v1.4.1 across all workflows
- pick up `pnpm/action-setup` v6.0.10, whose newer bootstrap fixes broken `@pnpm/exe` shims during package-manager self-updates

The setup action fix was released after oxc-project/setup-node#34.
2026-09-04 10:20:51 +00:00

85 lines
2.6 KiB
YAML

# Run cargo-llvm-cov and upload to codecov.io
name: Code Coverage
permissions: {}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "**.rs"
- ".github/workflows/codecov.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
coverage:
if: github.repository == 'oxc-project/oxc'
name: Code Coverage
runs-on: namespace-profile-linux-x64-default
steps:
- name: Checkout
uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- name: Clone submodules
uses: ./.github/actions/clone-submodules
- uses: namespacelabs/nscloud-cache-action@c5f8dab7560444c4bf8dbc64f1b203431873c547 # v1.6.1
with:
path: /home/runner/.rustup
cache: rust
- uses: oxc-project/setup-node@f46a72f95efdc55273fcd042d61c84e723b2892c # v1.4.1
- run: rustup component add llvm-tools-preview
- uses: taiki-e/install-action@37f7c5781271959fb65b6b35224e28652ff2b63d # v2.87.0
with:
tool: cargo-llvm-cov
- name: Run
env:
# Increase stack size to 100MiB, avoid `oxc_formatter` from stack overflowing when printing long assignment expressions.
RUST_MIN_STACK: 104857600
# Limit concurrent compiler processes to avoid exhausting the 8GiB runner.
CARGO_BUILD_JOBS: 2
run: cargo codecov --lcov --output-path lcov.info
- name: Upload Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
if-no-files-found: error
name: codecov
path: lcov.info
# codecov often fails, use another workflow for retry
upload-codecov:
name: Upload coverage file
runs-on: ubuntu-slim
needs: coverage
# Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout
if: env.CODECOV_TOKEN
uses: taiki-e/checkout-action@7d1e50e93dc4fb3bba58f85018fadf77898aee8b # v1.4.2
- name: Download coverage file
if: env.CODECOV_TOKEN
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: codecov
- name: Upload to codecov.io
if: env.CODECOV_TOKEN
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: lcov.info