Skip to content

Commit 93bd291

Browse files
authored
ci: emit test data to codecov + prevent failing status check (#928)
1 parent 62cff37 commit 93bd291

File tree

4 files changed

+40
-15
lines changed

4 files changed

+40
-15
lines changed

.github/workflows/autofix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
node-version: lts/*
2626

27-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
27+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
2828
name: 🟧 Install pnpm
2929
with:
3030
cache: true
@@ -41,4 +41,4 @@ jobs:
4141
- name: 🔠 Fix lint errors
4242
run: pnpm lint:fix
4343

44-
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
44+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 # 635ffb0c9798bd160680f18fd73371e355b85f27

.github/workflows/ci.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
node-version: lts/*
3333

34-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
34+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3535
name: 🟧 Install pnpm
3636
# pnpm cache skipped deliberately as the project is not actually installed here
3737

@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
node-version: lts/*
5151

52-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
52+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
5353
name: 🟧 Install pnpm
5454
with:
5555
cache: true
@@ -71,7 +71,7 @@ jobs:
7171
with:
7272
node-version: lts/*
7373

74-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
74+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
7575
name: 🟧 Install pnpm
7676
with:
7777
cache: true
@@ -80,7 +80,13 @@ jobs:
8080
run: pnpm install
8181

8282
- name: 🧪 Unit tests
83-
run: pnpm test:unit --project unit run --coverage
83+
run: pnpm test:unit run --coverage --reporter=junit --outputFile=test-report.junit.xml
84+
85+
- name: ⬆︎ Upload test results to Codecov
86+
if: ${{ !cancelled() }}
87+
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
88+
with:
89+
token: ${{ secrets.CODECOV_TOKEN }}
8490

8591
test:
8692
name: 🧪 Component tests
@@ -93,7 +99,7 @@ jobs:
9399
with:
94100
node-version: lts/*
95101

96-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
102+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
97103
name: 🟧 Install pnpm
98104
with:
99105
cache: true
@@ -105,12 +111,18 @@ jobs:
105111
run: pnpm playwright install chromium-headless-shell
106112

107113
- name: 🧪 Component tests
108-
run: pnpm vite test --project nuxt run --coverage
114+
run: pnpm test:nuxt run --coverage --reporter=junit --outputFile=test-report.junit.xml
115+
116+
- name: ⬆︎ Upload test results to Codecov
117+
if: ${{ !cancelled() }}
118+
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
119+
with:
120+
token: ${{ secrets.CODECOV_TOKEN }}
109121

110-
- name: Upload coverage reports to Codecov
122+
- name: ⬆︎ Upload coverage reports to Codecov
111123
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
112124
env:
113-
CODECOV_TOKEN: 17b4bed9-d407-4ce2-9c10-2ccd4328a1d9
125+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
114126

115127
browser:
116128
name: 🖥️ Browser tests
@@ -125,7 +137,7 @@ jobs:
125137
with:
126138
node-version: lts/*
127139

128-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
140+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
129141
name: 🟧 Install pnpm
130142
with:
131143
cache: true
@@ -153,7 +165,7 @@ jobs:
153165
with:
154166
node-version: lts/*
155167

156-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
168+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
157169
name: 🟧 Install pnpm
158170
with:
159171
cache: true
@@ -181,7 +193,7 @@ jobs:
181193
with:
182194
node-version: lts/*
183195

184-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
196+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
185197
name: 🟧 Install pnpm
186198
with:
187199
cache: true

.github/workflows/lunaria.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
with:
3333
node-version: lts/*
3434

35-
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
35+
- uses: pnpm/action-setup@1e1c8eafbd745f64b1ef30a7d7ed7965034c486c # 1e1c8eafbd745f64b1ef30a7d7ed7965034c486c
3636
name: 🟧 Install pnpm
3737
with:
3838
cache: true
@@ -41,4 +41,4 @@ jobs:
4141
run: pnpm install
4242

4343
- name: Generate Lunaria Overview
44-
uses: lunariajs/action@v1-prerelease
44+
uses: lunariajs/action@4911ad0736d1e3b20af4cb70f5079aea2327ed8e # v1-prerelease

codecov.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
informational: true
6+
patch:
7+
default:
8+
informational: true
9+
10+
comment:
11+
layout: 'reach,diff,flags,tree,components,tests,build'
12+
behavior: default
13+
require_changes: false

0 commit comments

Comments
 (0)