Skip to content

Commit 292eb45

Browse files
committed
fix: upload codevoc when a pr is being merge into main (#455)
1 parent 0ea3a04 commit 292eb45

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

.github/workflows/stack-release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,15 @@ jobs:
1818
secrets:
1919
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2020
GH_TOKEN: ${{ secrets.GH_TOKEN }}
21+
22+
upload-codecov:
23+
name: Upload code coverage to Codecov
24+
uses: ./.github/workflows/test.yml
25+
with:
26+
registryUrl: 'https://npm.pkg.github.com'
27+
codecov: true
28+
build: false
29+
lint: false
30+
secrets:
31+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/stack-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Stack test and coverage
33
on:
44
pull_request:
55

6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
610
jobs:
711
test:
812
name: Test all packages

.github/workflows/test.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ on:
1919
required: false
2020
type: boolean
2121

22+
build:
23+
default: true
24+
description: 'Run the build step'
25+
required: false
26+
type: boolean
27+
28+
lint:
29+
default: true
30+
description: 'Run the lint step'
31+
required: false
32+
type: boolean
33+
2234
secrets:
2335
NPM_TOKEN:
2436
description: 'The npm token if needed'
@@ -28,10 +40,6 @@ on:
2840
description: 'The codecov token if needed'
2941
required: false
3042

31-
concurrency:
32-
group: ${{ github.workflow }}-${{ github.ref }}
33-
cancel-in-progress: true
34-
3543
jobs:
3644
tests:
3745
name: Build, Lint and Tests
@@ -59,18 +67,20 @@ jobs:
5967

6068
# Run the build
6169
- name: Run Affected Build
70+
if: ${{ inputs.build }}
6271
shell: bash
6372
run: npx nx affected:build --base=remotes/origin/main
6473

6574
# Run the lint
6675
- name: Run Affected Lint
76+
if: ${{ inputs.lint }}
6777
shell: bash
6878
run: npx nx affected:lint --base=remotes/origin/main
6979

7080
# Run the tests
7181
- name: Run Affected Tests
72-
shell: bash
7382
if: ${{ !inputs.codecov }}
83+
shell: bash
7484
run: npx nx affected:test --base=remotes/origin/main
7585

7686
# We only run the affected test

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"buildable",
1616
"casl",
1717
"cdktf",
18+
"codecov",
1819
"Concat",
1920
"dbml",
2021
"dtos",
@@ -27,6 +28,7 @@
2728
"nrwl",
2829
"Rext",
2930
"tractr",
31+
"unittests",
3032
"Unsubscriber",
3133
"upsert"
3234
],

0 commit comments

Comments
 (0)