feat: export Version
#86
Workflow file for this run
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' | |
- '.github/workflows/codecov.yml' | |
push: | |
branches: | |
- main | |
paths: | |
- '**.rs' | |
- '.github/workflows/codecov.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref_name != 'main' }} | |
jobs: | |
coverage: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
- uses: Boshen/setup-rust@main | |
with: | |
cache-key: codecov | |
save-cache: ${{ github.ref_name == 'main' }} | |
tools: cargo-llvm-cov | |
components: llvm-tools-preview | |
- uses: pnpm/[email protected] | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- run: pnpm install | |
- run: cargo llvm-cov --lcov --output-path lcov.info | |
- uses: actions/upload-artifact@v4 | |
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 | |
# Check if the event is not triggered by a fork by checking whether CODECOV_TOKEN is set | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
steps: | |
- uses: taiki-e/checkout-action@v1 | |
if: env.CODECOV_TOKEN | |
- uses: actions/download-artifact@v4 | |
if: env.CODECOV_TOKEN | |
with: | |
name: codecov | |
- uses: codecov/codecov-action@v4 | |
if: env.CODECOV_TOKEN | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
files: lcov.info |