Skip to content

Commit 9f51ab7

Browse files
authored
Merge branch 'main' into replace-chalk-with-colorette
2 parents 77e42cc + a2d37ff commit 9f51ab7

File tree

3 files changed

+119
-58
lines changed

3 files changed

+119
-58
lines changed

.github/workflows/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
# Match SemVer major release branches
6+
# e.g. "12.x" or "8.x"
7+
- '[0-9]+.x'
8+
- 'main'
9+
- 'next'
10+
- 'next-major'
11+
- 'beta'
12+
- 'alpha'
13+
- '!all-contributors/**'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions: {}
20+
21+
jobs:
22+
validate:
23+
permissions:
24+
contents: read # to fetch code (actions/checkout)
25+
continue-on-error: ${{ matrix.react != 'latest' }}
26+
# ignore all-contributors PRs
27+
if: ${{ !contains(github.head_ref, 'all-contributors') }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
node: [18, 24]
32+
react: ['18.x', latest, canary, experimental]
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: ⬇️ Checkout repo
36+
uses: actions/checkout@v4
37+
38+
- name: ⎔ Setup node
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: ${{ matrix.node }}
42+
43+
- name: 📥 Download deps
44+
uses: bahmutov/npm-install@v1
45+
with:
46+
useLockFile: false
47+
48+
# TODO: Can be removed if https://github.com/kentcdodds/kcd-scripts/pull/146 is released
49+
- name: Verify format (`npm run format` committed?)
50+
run: npm run format -- --check --no-write
51+
52+
# as requested by the React team :)
53+
# https://reactjs.org/blog/2019/10/22/react-release-channels.html#using-the-next-channel-for-integration-testing
54+
- name: ⚛️ Setup react
55+
run: npm install react@${{ matrix.react }} react-dom@${{ matrix.react }}
56+
57+
- name: ⚛️ Setup react types
58+
if: ${{ matrix.react != 'canary' && matrix.react != 'experimental' }}
59+
run:
60+
npm install @types/react@${{ matrix.react }} @types/react-dom@${{
61+
matrix.react }}
62+
63+
- name: ▶️ Run validate script
64+
run: npm run validate
65+
66+
- name: ⬆️ Upload coverage report
67+
uses: codecov/codecov-action@v5
68+
with:
69+
fail_ci_if_error: true
70+
flags: ${{ matrix.react }}
71+
token: ${{ secrets.CODECOV_TOKEN }}
72+
73+
release:
74+
permissions:
75+
id-token: write # to enable use of OIDC (npm trusted publishing and provenance)
76+
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
77+
contents: write # to create release tags (cycjimmy/semantic-release-action)
78+
issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action)
79+
pull-requests: write # to be able to comment on released pull requests
80+
81+
needs: validate
82+
runs-on: ubuntu-latest
83+
if:
84+
${{ github.repository == 'testing-library/react-testing-library' &&
85+
github.event_name == 'push' }}
86+
steps:
87+
- name: ⬇️ Checkout repo
88+
uses: actions/checkout@v4
89+
90+
- name: ⎔ Setup node
91+
uses: actions/setup-node@v4
92+
with:
93+
node-version: 24
94+
95+
- name: 📥 Download deps
96+
uses: bahmutov/npm-install@v1
97+
with:
98+
useLockFile: false
99+
100+
- name: 🏗 Run build script
101+
run: npm run build
102+
103+
- name: 🚀 Release
104+
uses: cycjimmy/semantic-release-action@v5
105+
with:
106+
semantic_version: 25
107+
branches: |
108+
[
109+
'+([0-9])?(.{+([0-9]),x}).x',
110+
'main',
111+
'next',
112+
'next-major',
113+
{name: 'beta', prerelease: true},
114+
{name: 'alpha', prerelease: true}
115+
]
116+
env:
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/validate.yml

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
name: validate
22
on:
3-
push:
4-
branches:
5-
# Match SemVer major release branches
6-
# e.g. "12.x" or "8.x"
7-
- '[0-9]+.x'
8-
- 'main'
9-
- 'next'
10-
- 'next-major'
11-
- 'beta'
12-
- 'alpha'
13-
- '!all-contributors/**'
143
pull_request:
154

165
concurrency:
@@ -29,7 +18,7 @@ jobs:
2918
strategy:
3019
fail-fast: false
3120
matrix:
32-
node: [18, 20]
21+
node: [18, 24]
3322
react: ['18.x', latest, canary, experimental]
3423
runs-on: ubuntu-latest
3524
steps:
@@ -70,48 +59,3 @@ jobs:
7059
fail_ci_if_error: true
7160
flags: ${{ matrix.react }}
7261
token: ${{ secrets.CODECOV_TOKEN }}
73-
74-
release:
75-
permissions:
76-
actions: write # to cancel/stop running workflows (styfle/cancel-workflow-action)
77-
contents: write # to create release tags (cycjimmy/semantic-release-action)
78-
issues: write # to post release that resolves an issue (cycjimmy/semantic-release-action)
79-
80-
needs: main
81-
runs-on: ubuntu-latest
82-
if:
83-
${{ github.repository == 'testing-library/react-testing-library' &&
84-
github.event_name == 'push' }}
85-
steps:
86-
- name: ⬇️ Checkout repo
87-
uses: actions/checkout@v4
88-
89-
- name: ⎔ Setup node
90-
uses: actions/setup-node@v4
91-
with:
92-
node-version: 14
93-
94-
- name: 📥 Download deps
95-
uses: bahmutov/npm-install@v1
96-
with:
97-
useLockFile: false
98-
99-
- name: 🏗 Run build script
100-
run: npm run build
101-
102-
- name: 🚀 Release
103-
uses: cycjimmy/semantic-release-action@v2
104-
with:
105-
semantic_version: 17
106-
branches: |
107-
[
108-
'+([0-9])?(.{+([0-9]),x}).x',
109-
'main',
110-
'next',
111-
'next-major',
112-
{name: 'beta', prerelease: true},
113-
{name: 'alpha', prerelease: true}
114-
]
115-
env:
116-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = Object.assign(jestConfig, {
44
coverageThreshold: {
55
...jestConfig.coverageThreshold,
66
// Full coverage across the build matrix (React 18, 19) but not in a single job
7-
// Ful coverage is checked via codecov
7+
// Full coverage is checked via codecov
88
'./src/act-compat': {
99
branches: 90,
1010
},

0 commit comments

Comments
 (0)