oxc/.github/workflows/codecov.yml
Boshen c35fb19f4f
ci: install minimal profile (#253)
rustup show always install the profiles set in rust-toolchain.toml,
I added an action to remove this line so we can install components selectively.

This should reduce Rust installation time, which can be significant on Windows.
2023-04-05 11:50:30 +08:00

57 lines
1.4 KiB
YAML

# Run cargo-tarpaulin and upload to codecov.io
name: Code Coverage
on:
schedule:
- cron: '0 16 * * *' # 0:00 am Beijing Time
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true # Pull submodules for `cargo coverage`
- name: Install Rust Toolchain
uses: ./.github/actions/rustup
- name: Install cargo-tarpaulin
uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin
- name: Run
run: cargo tarpaulin --engine llvm --out Xml
- name: Upload cobertura.xml
uses: actions/upload-artifact@v3
with:
name: codecov
path: cobertura.xml
# codecov often fails, use another workflow for retry
upload-codecov:
name: Upload cobertura.xml
runs-on: ubuntu-latest
needs: coverage
steps:
- name: Download cobertura.xml
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: cobertura.xml