Skip to content

Commit 175f80c

Browse files
authored
feat: initial codecov changes (#2360)
1 parent 0108a8b commit 175f80c

File tree

6 files changed

+176
-24
lines changed

6 files changed

+176
-24
lines changed

.github/workflows/cli-ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ jobs:
5151
working-directory: cli
5252
run: bun test e2e
5353

54+
- name: Get Coverage
55+
run: pnpm run --filter wgc coverage
56+
57+
- name: Upload results to Codecov
58+
uses: codecov/codecov-action@v5
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
5462
build_test_node_matrix:
5563
timeout-minutes: 10
5664
runs-on: ubuntu-latest

.github/workflows/router-ci.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,12 +332,22 @@ jobs:
332332
docker exec "$cid" redis-cli -p 6379 ping
333333
docker exec "$cid" redis-cli -u "redis://cosmo:test@redis-0:6379" ping
334334
docker exec "$cid" redis-cli -u "redis://cosmo:test@redis-0:6379" cluster nodes
335+
335336
- name: Run Integration tests ${{ matrix.test_target }}
336337
working-directory: ./router-tests
337-
run: make test test_retry_count=0 test_params="-run '^Test[^(Flaky)]' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
338+
run: make test-coverage test_retry_count=0 test_params="-run '^Test[^(Flaky)]' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
339+
338340
- name: Run Flaky Integration tests ${{ matrix.test_target }}
339341
working-directory: ./router-tests
340-
run: make test test_retry_count=3 test_params="-run '^TestFlaky' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
342+
run: make test-coverage test_retry_count=3 test_params="-run '^TestFlaky' --timeout=5m -p 1 --parallel 10" test_target="${{ matrix.test_target }}"
343+
344+
- name: Upload results to Codecov
345+
uses: codecov/codecov-action@v5
346+
with:
347+
verbose: true
348+
files: |
349+
router-tests/coverage.out
350+
token: ${{ secrets.CODECOV_TOKEN }}
341351

342352
image_scan:
343353
if: github.event.pull_request.head.repo.full_name == github.repository

cli/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"build:bun": "bun build --compile --production --outfile wgc src/index.ts",
2727
"wgc": "tsx --env-file .env src/index.ts",
2828
"test": "pnpm lint && vitest run test/",
29-
"coverage": "vitest run --coverage",
29+
"coverage": "vitest run test/ --coverage",
3030
"lint": "eslint --cache --ext .ts,.mjs,.cjs . && prettier -c src",
3131
"lint:fix": "eslint --cache --fix --ext .ts,.mjs,.cjs . && prettier --write -c src",
3232
"e2e": "bun test e2e/"
@@ -98,6 +98,7 @@
9898
"@types/prompts": "2.4.9",
9999
"@types/semver": "7.7.0",
100100
"@types/tar": "6.1.13",
101+
"@vitest/coverage-v8": "3.2.4",
101102
"del-cli": "5.0.0",
102103
"eslint": "8.57.1",
103104
"eslint-config-unjs": "0.2.1",

codecov.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
target: 90
6+
threshold: 5
7+
informational: true # We don't want to block PRs based on the result

0 commit comments

Comments
 (0)