From f03d89c6dfadcad7d013c4f83b1bb3e5b3bc3fbf Mon Sep 17 00:00:00 2001 From: EugeneKisel-sm Date: Tue, 16 Dec 2025 16:57:47 +0100 Subject: [PATCH 1/4] Enhance Jest configuration and CI workflow for improved coverage reporting - Added coverage collection settings in jest.config.mjs to include TypeScript files while excluding specific patterns. - Updated GitHub Actions workflow to run tests with coverage and added a step to upload coverage reports to Codecov. - Included badges in README.md for build status and Codecov coverage tracking. --- .github/workflows/pull_request.yml | 16 +++++++++++++++- README.md | 3 +++ jest.config.mjs | 9 +++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index fca3c7a1..5549e8c8 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -35,7 +35,9 @@ jobs: - name: Install Dependencies run: npm ci - name: Run ${{ matrix.test }} Tests and Add Annotations - run: npm run test:${{ matrix.test }} -- --ci --reporters=default --reporters=github-actions --reporters=jest-junit + id: tests + continue-on-error: true + run: npm run test:${{ matrix.test }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit env: CONDUCTOR_SERVER_URL: ${{ matrix.test == 'integration:v4' && vars.SERVER_URL_V4 || vars.SERVER_URL }} CONDUCTOR_AUTH_KEY: ${{ matrix.test == 'integration:v4' && secrets.AUTH_KEY_V4 || secrets.AUTH_KEY }} @@ -48,3 +50,15 @@ jobs: name: ${{ matrix.test }} Test Report path: reports/${{ matrix.test }}-test-results.xml reporter: jest-junit + - name: Upload coverage to Codecov + if: always() + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage/lcov.info + flags: ${{ matrix.test }} + name: codecov-${{ matrix.test }}-node-${{ matrix.node-version }} + fail_ci_if_error: false + - name: Check Tests Status + if: steps.tests.outcome == 'failure' + run: exit 1 diff --git a/README.md b/README.md index c719bee4..41c78208 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Conductor OSS JavaScript/TypeScript SDK +[![Build Status](https://github.com/conductor-oss/javascript-sdk/actions/workflows/pull_request.yml/badge.svg)](https://github.com/conductor-oss/javascript-sdk/actions/workflows/pull_request.yml) +[![codecov](https://codecov.io/gh/conductor-oss/javascript-sdk/graph/badge.svg?token=CNCOB0N3FI)](https://codecov.io/gh/conductor-oss/javascript-sdk) + A comprehensive TypeScript/JavaScript client for [Conductor OSS](https://github.com/conductor-oss/conductor), enabling developers to build, orchestrate, and monitor distributed workflows with ease. [Conductor](https://www.conductor-oss.org/) is the leading open-source orchestration platform allowing developers to build highly scalable distributed applications. diff --git a/jest.config.mjs b/jest.config.mjs index cd5d205b..a3538000 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -4,6 +4,15 @@ export default { preset: "ts-jest", clearMocks: true, coverageProvider: "v8", + collectCoverageFrom: [ + "src/**/*.{ts,tsx}", + "!src/**/*.d.ts", + "!src/**/__tests__/**", + "!src/**/*.test.{ts,tsx}", + "!src/**/generated/**", + "!src/**/spec/**", + ], + coverageReporters: ["text", "lcov", "cobertura"], transformIgnorePatterns: ["/node_modules/", "\\.pnp\\.[^\\/]+$"], transform: { "^.+\\.tsx?$": [ From 0c63f34c613d9c7f5f5ed1566ed31623f55effac Mon Sep 17 00:00:00 2001 From: EugeneKisel-sm Date: Tue, 16 Dec 2025 17:09:43 +0100 Subject: [PATCH 2/4] Update collectCoverageFrom --- jest.config.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/jest.config.mjs b/jest.config.mjs index a3538000..f98047e0 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -7,8 +7,6 @@ export default { collectCoverageFrom: [ "src/**/*.{ts,tsx}", "!src/**/*.d.ts", - "!src/**/__tests__/**", - "!src/**/*.test.{ts,tsx}", "!src/**/generated/**", "!src/**/spec/**", ], From 2d64c72b3a6b5e93022cf8e249b6140b0bff33e7 Mon Sep 17 00:00:00 2001 From: EugeneKisel-sm Date: Tue, 16 Dec 2025 17:23:05 +0100 Subject: [PATCH 3/4] Remove continue-on-error --- .github/workflows/pull_request.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5549e8c8..59301c37 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -36,7 +36,6 @@ jobs: run: npm ci - name: Run ${{ matrix.test }} Tests and Add Annotations id: tests - continue-on-error: true run: npm run test:${{ matrix.test }} -- --ci --coverage --reporters=default --reporters=github-actions --reporters=jest-junit env: CONDUCTOR_SERVER_URL: ${{ matrix.test == 'integration:v4' && vars.SERVER_URL_V4 || vars.SERVER_URL }} @@ -59,6 +58,3 @@ jobs: flags: ${{ matrix.test }} name: codecov-${{ matrix.test }}-node-${{ matrix.node-version }} fail_ci_if_error: false - - name: Check Tests Status - if: steps.tests.outcome == 'failure' - run: exit 1 From 760a77f5dcb103dd2ec28e5cc7a25b7bfa93dfd4 Mon Sep 17 00:00:00 2001 From: EugeneKisel-sm Date: Tue, 16 Dec 2025 17:35:29 +0100 Subject: [PATCH 4/4] Update CI workflow to run on push to main and allow manual dispatch --- .github/workflows/pull_request.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 59301c37..a6808c17 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,6 +1,11 @@ name: Continuous Integration -on: pull_request +on: + push: + branches: + - main + pull_request: + workflow_dispatch: jobs: linter: