Skip to content

Commit 3cab272

Browse files
Merge pull request #18930 from getsentry/feat/codecov-new
feat: added support for the new codecov action
2 parents 2ed4352 + 167acdc commit 3cab272

File tree

4 files changed

+21
-57
lines changed

4 files changed

+21
-57
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ jobs:
175175
'nx-never-restore'}}
176176

177177
- name: Build packages
178-
# Set the CODECOV_TOKEN for Bundle Analysis
179-
env:
180-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
181178
run: yarn build
182179

183180
- name: Upload build artifacts
@@ -431,18 +428,12 @@ jobs:
431428
run: yarn test:ci:browser
432429
if: github.event_name != 'pull_request'
433430

434-
- name: Compute test coverage
435-
uses: codecov/codecov-action@v5
436-
with:
437-
token: ${{ secrets.CODECOV_TOKEN }}
438-
439-
- name: Upload test results to Codecov
431+
- name: Parse and Upload Coverage
440432
if: cancelled() == false
441433
continue-on-error: true
442-
uses: codecov/test-results-action@v1
434+
uses: getsentry/codecov-action@main
443435
with:
444-
files: packages/**/*.junit.xml
445-
token: ${{ secrets.CODECOV_TOKEN }}
436+
token: ${{ secrets.GITHUB_TOKEN }}
446437

447438
job_bun_unit_tests:
448439
name: Bun Unit Tests
@@ -538,18 +529,12 @@ jobs:
538529
env:
539530
NODE_VERSION: ${{ matrix.node }}
540531

541-
- name: Compute test coverage
542-
uses: codecov/codecov-action@v5
543-
with:
544-
token: ${{ secrets.CODECOV_TOKEN }}
545-
546-
- name: Upload test results to Codecov
532+
- name: Parse and Upload Coverage
547533
if: cancelled() == false
548534
continue-on-error: true
549-
uses: codecov/test-results-action@v1
535+
uses: getsentry/codecov-action@main
550536
with:
551-
files: packages/**/*.junit.xml
552-
token: ${{ secrets.CODECOV_TOKEN }}
537+
token: ${{ secrets.GITHUB_TOKEN }}
553538

554539
job_browser_playwright_tests:
555540
name:
@@ -644,13 +629,13 @@ jobs:
644629
overwrite: true
645630
retention-days: 7
646631

647-
- name: Upload test results to Codecov
632+
- name: Parse and Upload Coverage
648633
if: cancelled() == false
649634
continue-on-error: true
650-
uses: codecov/test-results-action@v1
635+
uses: getsentry/codecov-action@main
651636
with:
637+
token: ${{ secrets.GITHUB_TOKEN }}
652638
directory: dev-packages/browser-integration-tests
653-
token: ${{ secrets.CODECOV_TOKEN }}
654639

655640
job_browser_loader_tests:
656641
name: PW ${{ matrix.bundle }} Tests
@@ -705,13 +690,13 @@ jobs:
705690
overwrite: true
706691
retention-days: 7
707692

708-
- name: Upload test results to Codecov
693+
- name: Parse and Upload Coverage
694+
uses: getsentry/codecov-action@main
709695
if: cancelled() == false
710696
continue-on-error: true
711-
uses: codecov/test-results-action@v1
712697
with:
698+
token: ${{ secrets.GITHUB_TOKEN }}
713699
directory: dev-packages/browser-integration-tests
714-
token: ${{ secrets.CODECOV_TOKEN }}
715700

716701
job_check_for_faulty_dts:
717702
name: Check for faulty .d.ts files
@@ -779,13 +764,13 @@ jobs:
779764
working-directory: dev-packages/node-integration-tests
780765
run: yarn test
781766

782-
- name: Upload test results to Codecov
767+
- name: Parse and Upload Coverage
783768
if: cancelled() == false
784769
continue-on-error: true
785-
uses: codecov/test-results-action@v1
770+
uses: getsentry/codecov-action@main
786771
with:
772+
token: ${{ secrets.GITHUB_TOKEN }}
787773
directory: dev-packages/node-integration-tests
788-
token: ${{ secrets.CODECOV_TOKEN }}
789774

790775
job_cloudflare_integration_tests:
791776
name: Cloudflare Integration Tests
@@ -846,13 +831,13 @@ jobs:
846831
cd packages/remix
847832
yarn test:integration:ci
848833
849-
- name: Upload test results to Codecov
834+
- name: Parse and Upload Coverage
850835
if: cancelled() == false
851836
continue-on-error: true
852-
uses: codecov/test-results-action@v1
837+
uses: getsentry/codecov-action@main
853838
with:
854839
directory: packages/remix
855-
token: ${{ secrets.CODECOV_TOKEN }}
840+
token: ${{ secrets.GITHUB_TOKEN }}
856841

857842
job_e2e_prepare:
858843
name: Prepare E2E tests
@@ -1037,13 +1022,13 @@ jobs:
10371022
retention-days: 7
10381023
if-no-files-found: ignore
10391024

1040-
- name: Upload test results to Codecov
1025+
- name: Parse and Upload Coverage
10411026
if: cancelled() == false
10421027
continue-on-error: true
1043-
uses: codecov/test-results-action@v1
1028+
uses: getsentry/codecov-action@main
10441029
with:
10451030
directory: dev-packages/e2e-tests
1046-
token: ${{ secrets.CODECOV_TOKEN }}
1031+
token: ${{ secrets.GITHUB_TOKEN }}
10471032

10481033
# - We skip optional tests on release branches
10491034
job_optional_e2e_tests:

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ faster, so we can get back to enjoying technology. If you want to join us
99
[<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_
1010

1111
[![Build & Test](https://github.com/getsentry/sentry-javascript/workflows/CI:%20Build%20&%20Test/badge.svg)](https://github.com/getsentry/sentry-javascript/actions)
12-
[![codecov](https://codecov.io/gh/getsentry/sentry-javascript/branch/develop/graph/badge.svg)](https://codecov.io/gh/getsentry/sentry-javascript)
1312
[![npm version](https://img.shields.io/npm/v/@sentry/core.svg)](https://www.npmjs.com/package/@sentry/core)
1413
[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/Ww9hbqr)
1514

codecov.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ codecov:
33
notify:
44
require_ci_to_pass: no
55

6-
ai_pr_review:
7-
enabled: true
8-
method: 'label'
9-
label_name: 'ci-codecov-ai-review'
10-
116
coverage:
127
precision: 2
138
round: down

dev-packages/rollup-utils/plugins/npmPlugins.mjs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,3 @@ export function makeRrwebBuildPlugin({ excludeShadowDom, excludeIframe } = {}) {
167167
values,
168168
});
169169
}
170-
171-
/**
172-
* Plugin that uploads bundle analysis to codecov.
173-
*
174-
* @param type The type of bundle being uploaded.
175-
* @param prefix The prefix for the codecov bundle name. Defaults to 'npm'.
176-
*/
177-
export function makeCodeCovPlugin() {
178-
const packageJson = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), './package.json'), { encoding: 'utf8' }));
179-
return codecovRollupPlugin({
180-
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
181-
bundleName: packageJson.name,
182-
uploadToken: process.env.CODECOV_TOKEN,
183-
});
184-
}

0 commit comments

Comments
 (0)