-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update github actions to test on react 18+
- Loading branch information
Showing
2 changed files
with
9 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
build: [cjs, umd] # [cjs, esm, umd, system] | ||
env: [development, production] | ||
build: [cjs, esm, umd] # [cjs, esm, umd, system] | ||
env: [development] # [development, production] | ||
devtools-skip: | ||
- CI-MATRIX-NOSKIP | ||
include: | ||
|
@@ -39,10 +39,6 @@ jobs: | |
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- run: yarn install --frozen-lockfile --check-files | ||
- run: yarn build | ||
- name: Use React 17 for production test | ||
if: ${{ matrix.env == 'production' }} | ||
run: | | ||
yarn add -D [email protected] [email protected] @testing-library/[email protected] | ||
- name: Patch for DEV-ONLY | ||
if: ${{ matrix.env == 'development' }} | ||
run: | | ||
|
@@ -60,7 +56,7 @@ jobs: | |
- name: Patch for ESM | ||
if: ${{ matrix.build == 'esm' }} | ||
run: | | ||
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/esm\1.js" package.json | ||
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/esm\1.js/" package.json | ||
sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.tsx | ||
env: | ||
NODE_ENV: ${{ matrix.env }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,8 +28,6 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
react: | ||
- 16.8.0 | ||
- 17.0.0 | ||
- 18.0.0 | ||
- 18.1.0 | ||
- 18.2.0 | ||
|
@@ -39,18 +37,18 @@ jobs: | |
- CI-MATRIX-NOSKIP | ||
include: | ||
- devtools-skip: CI-MATRIX-[2345] | ||
react: 16.8.0 | ||
react: 18.0.0 | ||
- devtools-skip: CI-MATRIX-[1345] | ||
react: 16.8.0 | ||
react: 18.0.0 | ||
- devtools-skip: CI-MATRIX-[1245] | ||
react: 16.8.0 | ||
react: 18.0.0 | ||
- devtools-skip: CI-MATRIX-[1235] | ||
react: 16.8.0 | ||
react: 18.0.0 | ||
- devtools-skip: CI-MATRIX-[1234] | ||
react: 16.8.0 | ||
react: 18.0.0 | ||
exclude: | ||
- devtools-skip: CI-MATRIX-NOSKIP | ||
react: 16.8.0 | ||
react: 18.0.0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
|
@@ -59,18 +57,6 @@ jobs: | |
cache: yarn | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- run: yarn install --frozen-lockfile --check-files | ||
- name: Install legacy testing-library | ||
if: ${{ startsWith(matrix.react, '16.') || startsWith(matrix.react, '17.') }} | ||
run: yarn add -D @testing-library/[email protected] | ||
- name: Patch for React 16 | ||
if: ${{ startsWith(matrix.react, '16.') }} | ||
run: | | ||
sed -i~ '1s/^/import React from "react";/' tests/*.tsx | ||
sed -i~ 's/"jsx": "react-jsx"/"jsx": "react"/' tsconfig.json | ||
sed -i~ 's/import\.meta\.env[?]\.MODE/"DEVELOPMENT".toLowerCase()/' src/*.ts src/*/*.ts | ||
sed -i~ "s/it('\[${DEVTOOLS_SKIP}\]/it.skip('/" tests/devtools.test.tsx | ||
env: | ||
DEVTOOLS_SKIP: ${{ matrix.devtools-skip }} | ||
- name: Test ${{ matrix.react }} ${{ matrix.devtools-skip }} | ||
run: | | ||
yarn add -D react@${{ matrix.react }} react-dom@${{ matrix.react }} | ||
|