Skip to content
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Build w/ React18 & 19'

on:
workflow_call:

jobs:
build:
name: 'Build'
runs-on: ubuntu-latest
strategy:
matrix:
react: ['18', '19']
env:
CYPRESS_INSTALL_BINARY: 0
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install
run: yarn install --immutable

- name: Install 18
if: ${{ matrix.react == '18' }}
run: |
yarn add "@types/react@18" "@types/react-dom@18" --dev
yarn add react@18 react-dom@18

- name: Build
run: yarn build

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-${{ matrix.react }}
path: packages/*/dist
51 changes: 2 additions & 49 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,61 +35,14 @@ jobs:
compression: 'gzip'
clean-script: 'clean:remove-modules'

install:
name: 'Install Dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install and Build
run: yarn install --immutable
build:
uses: './.github/workflows/build.yml'

test:
needs: ['build']
uses: './.github/workflows/test.yml'

build:
needs: ['install']
name: 'Build'
runs-on: ubuntu-latest
strategy:
matrix:
react: ['18', '19']
env:
CYPRESS_INSTALL_BINARY: 0
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version-file: '.nvmrc'
cache: 'yarn'

- name: Install
run: yarn install --immutable

- name: Install 19
if: ${{ matrix.react == '19' }}
run: |
echo "$(jq '.resolutions += {"@types/react": "npm:types-react@rc", "@types/react-dom": "npm:types-react-dom@rc" }' package.json)" > package.json
yarn add react@rc react-dom@rc
yarn

- name: Build
run: yarn build

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: build-${{ matrix.react }}
path: packages/*/dist

lint:
needs: ['install']
runs-on: ubuntu-latest
env:
CYPRESS_INSTALL_BINARY: 0
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: 'Release - Snapshot'
on: workflow_dispatch

jobs:
build:
uses: './.github/workflows/build.yml'

test:
needs: ['build']
uses: './.github/workflows/test.yml'
with:
reportCoverage: false
Expand Down
Loading