Skip to content

Commit 8d3fec2

Browse files
fix(posts): update "How to shard Jest tests in GitHub Actions"
Post: 2022-05-13-jest-shard-test-github-actions.md Remove Code Climate
1 parent 75b16f7 commit 8d3fec2

1 file changed

Lines changed: 1 addition & 45 deletions

File tree

_posts/2022/2022-05-13-jest-shard-test-github-actions.md

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
title: How to shard Jest tests in GitHub Actions
44
date: 2022-05-13 19:23:28
5-
updated: 2024-02-09 15:15:04
5+
updated: 2025-07-23 12:15:33
66
excerpt: How to shard Jest tests in GitHub Actions.
77
categories: jest test github actions ci
88
---
@@ -50,47 +50,3 @@ jobs:
5050
{% endraw %}
5151
5252
Sharding will speed up the time it takes for tests to run since they run in parallel, but it will also increase the total duration, which will increase the billable time.
53-
54-
## Code Climate
55-
56-
Upload the coverage to [Code Climate](https://docs.codeclimate.com/docs/configuring-test-coverage):
57-
58-
{% raw %}
59-
60-
```yml
61-
# .github/workflows/test.yml
62-
on: push
63-
jobs:
64-
test:
65-
runs-on: ubuntu-latest
66-
strategy:
67-
matrix:
68-
shard: [1, 2]
69-
steps:
70-
- npx jest --shard=${{ matrix.shard }}/${{ strategy.job-total }}
71-
- uses: remarkablemark/setup-codeclimate@v2
72-
- run: cc-test-reporter format-coverage -t lcov -o coverage/climate.${{ matrix.shard }}.json
73-
- uses: actions/upload-artifact@v4
74-
with:
75-
name: coverage-${{ matrix.shard }}
76-
path: coverage/climate.*.json
77-
retention-days: 1
78-
79-
coverage:
80-
runs-on: ubuntu-latest
81-
needs: [test]
82-
steps:
83-
- uses: actions/download-artifact@v4
84-
with:
85-
path: coverage
86-
pattern: coverage-*
87-
merge-multiple: true
88-
- uses: remarkablemark/setup-codeclimate@v2
89-
- run: |
90-
cc-test-reporter sum-coverage coverage/*
91-
cc-test-reporter upload-coverage
92-
env:
93-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
94-
```
95-
96-
{% endraw %}

0 commit comments

Comments
 (0)