diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac48ffef6e92..64f4b42fb824 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,10 +2,10 @@ name: ci on: push: branches: - - main + - main-codecov pull_request: branches: - - main + - main-codecov merge_group: types: [checks_requested] @@ -80,6 +80,12 @@ jobs: yarn carbon-cli check --ignore '**/@(node_modules|examples|components|react|fixtures|compat)/**' 'packages/**/*.scss' - name: Run tests run: yarn test --ci + - name: Upload coverage reports to Codecov with GitHub Action + uses: codecov/codecov-action@v4.2.0 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + flags: jest-components e2e: name: 'test:e2e' diff --git a/.github/workflows/codecov-components.yml b/.github/workflows/codecov-components.yml deleted file mode 100644 index a7aa8bdc73ea..000000000000 --- a/.github/workflows/codecov-components.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Jest components - - on: - push: - paths: - - "packages/react/src/components/**" -jobs: - build: - runs-on: ubuntu-latest - name: Test JS frontend - defaults: - run: - working-directory: ./packages/react/src/components - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v2 - with: - node-version: "20" - - name: Install requirements - run: npm install - - name: Run tests and collect coverage - run: npm run test - - name: Upload coverage reports to Codecov with GitHub Action - uses: codecov/codecov-action@v4.2.0 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - flags: jest-components \ No newline at end of file diff --git a/codecov.yml b/codecov.yml index 2e5ca9e1a54e..e0903a191df6 100644 --- a/codecov.yml +++ b/codecov.yml @@ -9,7 +9,7 @@ flag_management: individual_flags: - name: jest-components paths: - - packages/react/src/components/ + - packages/react/src/components/**/*-test.js statuses: - type: project target: auto diff --git a/packages/react/src/components/Accordion/__tests__/Accordion-test.js b/packages/react/src/components/Accordion/__tests__/Accordion-test.js index 3a4a16c52de8..2be527dd4bc4 100644 --- a/packages/react/src/components/Accordion/__tests__/Accordion-test.js +++ b/packages/react/src/components/Accordion/__tests__/Accordion-test.js @@ -13,7 +13,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; describe('Accordion', () => { - it('should render', () => { + it('should render test', () => { const { asFragment } = render( diff --git a/packages/react/src/components/Accordion/__tests__/__snapshots__/Accordion-test.js.snap b/packages/react/src/components/Accordion/__tests__/__snapshots__/Accordion-test.js.snap index 8fa532cac89a..0689f3d2c4a5 100644 --- a/packages/react/src/components/Accordion/__tests__/__snapshots__/Accordion-test.js.snap +++ b/packages/react/src/components/Accordion/__tests__/__snapshots__/Accordion-test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Accordion should render 1`] = ` +exports[`Accordion should render test 1`] = `