Skip to content

Commit

Permalink
Fix coverage in CI (#4)
Browse files Browse the repository at this point in the history
* Add coverage reporters

* Coverage no directory specify

* Run pnpm test filter

* Downgrade NodeJS to 18

* Exclude coverage folder in web

* Run pnpm install

* Revert "Run pnpm install"

This reverts commit 8c631b4.

* Frozen lockfile

* Set coverage type cobertura

* Test pnpm install without cache

* Test pnpm install without cache

* Revert "Test pnpm install without cache"

This reverts commit 42e31d1.

* Upload web coverage

* Change to normal test

* Revert "Change to normal test"

This reverts commit 878f636.

* Try disabling test cache

* Prod false, cache tests

* Try pnpm 9

* Run tests serially

* Revert "Try pnpm 9"

This reverts commit cc6dbe6.

* jest verbose

* Revert "jest verbose"

This reverts commit d0af7b0.

* coverageProvider babel?
  • Loading branch information
dobrac authored Apr 18, 2024
1 parent 94107de commit 60ccf2f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 18

- uses: pnpm/action-setup@v3
name: Install pnpm
Expand All @@ -39,15 +39,22 @@ jobs:
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile --prod false

- name: Run Jest
run: cd web && pnpm test:ci
run: pnpm --filter web test:ci

- name: Upload Web Coverage
uses: actions/upload-artifact@v3
with:
name: coverage-web
path: web/coverage

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
directory: web/coverage
token: ${{ secrets.CODECOV_TOKEN }}
slug: dobrac/grpcflair
verbose: true
files: ./web/coverage/cobertura-coverage.xml

1 change: 1 addition & 0 deletions .idea/grpcflair.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion web/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const customJestConfig = {
coveragePathIgnorePatterns: ["/node_modules/", "/tests/", "/src/contexts/"],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
coverageProvider: "babel",

// A list of reporter names that Jest uses when writing coverage reports
coverageReporters: ["json", "lcov", "text", "clover", "text", "cobertura"],

// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
moduleNameMapper: {
Expand Down

0 comments on commit 60ccf2f

Please sign in to comment.