From 02181426269e5774c41b2d783f9c9a770254d967 Mon Sep 17 00:00:00 2001 From: anastasiia_glushkova Date: Sat, 17 Jan 2026 20:03:38 +0100 Subject: [PATCH 1/2] ci: use codecov for code coverage quality gates --- .github/workflows/angular.yml | 9 ++++++++- .github/workflows/core.yml | 9 ++++++++- angular/angular.json | 8 ++++++-- codecov.yml | 30 ++++++++++++++++++++++++++++++ core/stencil.config.ts | 5 ++++- 5 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 codecov.yml diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index f4392da3a..07e3f1d75 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -81,5 +81,12 @@ jobs: pnpm run build:core pnpm run build:angular pnpm run build:angular-formly - - name: Test + - name: Test with coverage run: pnpm --filter @haiilo/catalyst-angular-workspace run test:ci + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: ./angular/coverage/**/lcov.info + flags: angular + name: angular-coverage + fail_ci_if_error: true diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 280ddb9e8..1386e1a58 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -106,5 +106,12 @@ jobs: run: pnpm run build:tokens - name: Install Chrome run: node node_modules/puppeteer/install.mjs - - name: Test + - name: Test with coverage run: pnpm --filter @haiilo/catalyst run test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + with: + files: ./core/coverage/lcov.info + flags: core + name: core-coverage + fail_ci_if_error: true diff --git a/angular/angular.json b/angular/angular.json index 235a52e42..5edeaa8d8 100644 --- a/angular/angular.json +++ b/angular/angular.json @@ -30,7 +30,9 @@ "tsConfig": "projects/catalyst/tsconfig.spec.json", "watch": false, "browsers": ["chromium"], - "runnerConfig": "vitest.config.ts" + "runnerConfig": "vitest.config.ts", + "coverage": true, + "coverageReporters": ["lcov", "json", "text"] } } } @@ -62,7 +64,9 @@ "tsConfig": "projects/catalyst-formly/tsconfig.spec.json", "watch": false, "browsers": ["chromium"], - "runnerConfig": "vitest.config.ts" + "runnerConfig": "vitest.config.ts", + "coverage": true, + "coverageReporters": ["lcov", "json", "text"] } } } diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..6b6d63908 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,30 @@ +coverage: + status: + project: + default: + target: 50% + threshold: 1% + if_ci_failed: error + patch: + default: + target: 70% + threshold: 1% + if_ci_failed: error + +comment: + layout: "header, diff, flags, components" + behavior: default + require_changes: false + require_base: false + require_head: true + +flags: + core: + paths: + - core/src/ + carryforward: true + angular: + paths: + - angular/projects/catalyst/src/ + - angular/projects/catalyst-formly/src/ + carryforward: true diff --git a/core/stencil.config.ts b/core/stencil.config.ts index 950def2ef..5dad20cb3 100644 --- a/core/stencil.config.ts +++ b/core/stencil.config.ts @@ -116,6 +116,9 @@ export const config: Config = { transform: { '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': './stencil.transformer.js' }, - transformIgnorePatterns: ['node_modules/(?!(?:.pnpm/)?(@haiilo))'] + transformIgnorePatterns: ['node_modules/(?!(?:.pnpm/)?(@haiilo))'], + collectCoverage: true, + coverageDirectory: 'coverage', + coverageReporters: ['lcov', 'text', 'json-summary', 'html'] } }; From daec2e9b392ff8034cc1402f93779850ab2cdb23 Mon Sep 17 00:00:00 2001 From: anastasiia_glushkova Date: Sun, 18 Jan 2026 20:34:54 +0100 Subject: [PATCH 2/2] ci: add CODECOV_TOKEN to coverage workflow --- .github/workflows/angular.yml | 1 + .github/workflows/core.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 07e3f1d75..8a5eafc04 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -86,6 +86,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: + token: ${{ secrets.CODECOV_TOKEN }} files: ./angular/coverage/**/lcov.info flags: angular name: angular-coverage diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index 1386e1a58..53b0cb066 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -111,6 +111,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: + token: ${{ secrets.CODECOV_TOKEN }} files: ./core/coverage/lcov.info flags: core name: core-coverage