From 4211c97f9b9d372a873ede9a545240468171e3c2 Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 17 Apr 2025 15:25:17 +0300 Subject: [PATCH] ci: improve codecov report (#19430) --- .github/workflows/test.yml | 52 +++++++++++++++++++++++--------------- README.md | 2 +- codecov.yml | 40 ++++++++++++++++++++--------- 3 files changed, 61 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7756d253d..5cabc743f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,6 +48,38 @@ jobs: yarn upgrade typescript@5.0 yarn --frozen-lockfile yarn type-validate + validate-legacy-node: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 10.x + cache: "yarn" + # Remove `devDependencies` from `package.json` to avoid `yarn install` compatibility error + - run: node -e "const content = require('./package.json');delete content.devDependencies;require('fs').writeFileSync('package.json', JSON.stringify(content, null, 2));" + - run: yarn install --production --frozen-lockfile + types: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: "yarn" + - run: yarn --frozen-lockfile + - run: yarn link --frozen-lockfile || true + - run: yarn link webpack --frozen-lockfile + - run: yarn cover:types + - uses: codecov/codecov-action@v5 + with: + flags: types + disable_search: true + files: ./coverage/coverage-types.json + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} basic: runs-on: ubuntu-latest steps: @@ -61,24 +93,6 @@ jobs: - run: yarn link --frozen-lockfile || true - run: yarn link webpack --frozen-lockfile - run: yarn test:basic --ci - - uses: codecov/codecov-action@v5 - with: - flags: basic - functionalities: gcov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - validate-legacy-node: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 10.x - cache: "yarn" - # Remove `devDependencies` from `package.json` to avoid `yarn install` compatibility error - - run: node -e "const content = require('./package.json');delete content.devDependencies;require('fs').writeFileSync('package.json', JSON.stringify(content, null, 2));" - - run: yarn install --production --frozen-lockfile unit: runs-on: ubuntu-latest steps: @@ -100,7 +114,6 @@ jobs: - uses: codecov/codecov-action@v5 with: flags: unit - functionalities: gcov env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} integration: @@ -191,6 +204,5 @@ jobs: - uses: codecov/codecov-action@v5 with: flags: integration - functionalities: gcov env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 4a07912ea..bcbe75ed4 100644 --- a/README.md +++ b/README.md @@ -676,5 +676,5 @@ Before we started using OpenCollective, donations were made anonymously. Now tha [builds2-url]: https://dev.azure.com/webpack/webpack/_build/latest?definitionId=3&branchName=main [dependency-review-url]: https://github.com/webpack/webpack/actions/workflows/dependency-review.yml [dependency-review]: https://github.com/webpack/webpack/actions/workflows/dependency-review.yml/badge.svg -[cover]: https://codecov.io/gh/webpack/webpack/branch/master/graph/badge.svg?token=mDP3mQJNnn +[cover]: https://codecov.io/gh/webpack/webpack/branch/main/graph/badge.svg?token=mDP3mQJNnn [cover-url]: https://codecov.io/gh/webpack/webpack diff --git a/codecov.yml b/codecov.yml index 1d01587a9..56ee26d6c 100644 --- a/codecov.yml +++ b/codecov.yml @@ -7,31 +7,47 @@ coverage: status: project: default: off - basic: - flags: basic + types: + flags: + - types + target: auto + unit: + flags: + - unit target: auto integration: - flags: integration + flags: + - integration target: auto patch: default: off - basic: - flags: basic + types: + flags: + - types + target: 90% + base: pr + unit: + flags: + - unit target: 90% base: pr integration: - flags: integration + flags: + - integration target: 90% base: pr changes: default: off - basic: - flags: basic - target: 0% + types: + flags: + - types + unit: + flags: + - unit integration: - flags: integration - target: 0% + flags: + - integration comment: off flags: - basic: + types: joined: false