forked from oxc-project/oxc
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (68 loc) · 2.52 KB
/
codecov.yml
File metadata and controls
82 lines (68 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- name: Clone submodules
uses: ./.github/actions/clone-submodules
- uses: namespacelabs/nscloud-cache-action@a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9 # v1.4.2
with:
path: /home/runner/.rustup
cache: rust
- uses: oxc-project/setup-node@4c26e7cb3605b6bdef5450dacd02c434b10fd8ba # v1.2.0
- run: rustup component add llvm-tools-preview
- uses: taiki-e/install-action@fd0f63e180a477d7434580b6d80817978b9ff2b8 # v2.70.1
with:
tool: cargo-llvm-cov
- name: Run
env:
# Increase stack size to 10MB, avoid `oxc_formatter` from stack overflowing when printing long assignment expressions.
RUST_MIN_STACK: 104857600
run: cargo codecov --lcov --output-path lcov.info
- name: Upload Artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
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@83ed61bfbe2b8abbb3c66e8b65b1335484c70009 # v1.4.1
- 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@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: lcov.info