From 4f17d4edc5851854c0a0a34ff707368b30bfad9e Mon Sep 17 00:00:00 2001 From: Charles Kornoelje <33156025+charkour@users.noreply.github.com> Date: Sat, 9 Dec 2023 00:23:29 -0500 Subject: [PATCH] chore: update github actions to test on react 18+ --- .github/workflows/test-multiple-builds.yml | 10 +++----- .github/workflows/test-multiple-versions.yml | 26 +++++--------------- 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/.github/workflows/test-multiple-builds.yml b/.github/workflows/test-multiple-builds.yml index 0ce52235c8..dfe51f45da 100644 --- a/.github/workflows/test-multiple-builds.yml +++ b/.github/workflows/test-multiple-builds.yml @@ -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 react@17.0.2 react-dom@17.0.2 @testing-library/react@12.1.4 - 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/\/src\(.*\)\.ts/\/dist\/esm\1.js" package.json + sed -i~ "s/\/src\(.*\)\.ts/\/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 }} diff --git a/.github/workflows/test-multiple-versions.yml b/.github/workflows/test-multiple-versions.yml index cc13242a97..bdf8635e3a 100644 --- a/.github/workflows/test-multiple-versions.yml +++ b/.github/workflows/test-multiple-versions.yml @@ -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/react@12.1.4 - - 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 }}