react-next #1270
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
name: react-next | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" # Runs at 00:00 UTC every day | |
jobs: | |
install: | |
# Prevent workflow from running on forks. | |
# Because the test job depends on install, preventing install also prevents the test from being run. | |
if: github.repository == 'ariakit/ariakit' | |
name: Install node modules | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Cache npm | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: npm-${{ hashFiles('package-lock.json') }} | |
restore-keys: npm- | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci --no-audit | |
react-next: | |
name: Test React Next (${{ matrix.shard }}) | |
needs: install | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: ["1/2", "2/2"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
id: cache-node-modules | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci --no-audit | |
- name: Print version of react@next | |
run: npm view react@next && npm view react-dom@next | |
- name: Install React@next | |
run: npm run reactnext | |
- name: Test | |
run: npm test -- --shard ${{ matrix.shard }} |