Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): jest 29 migration #5069

Merged
merged 18 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 87 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ on:
branches: [next]

jobs:
test:
install:
timeout-minutes: 60
name: Test (${{ matrix.os }} / node ${{ matrix.node }})
name: Install (${{ matrix.os }} / node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
continue-on-error: ${{ matrix.experimental }}

strategy:
# we want to know if a test fails on a specific node version
fail-fast: false
matrix:
os: [ubuntu-latest]
Expand Down Expand Up @@ -51,6 +50,19 @@ jobs:
${{ runner.os }}-modules-
${{ runner.os }}-

- name: Cache build
id: cache-build
uses: actions/cache@v3
env:
cache-name: cache-build
with:
path: './*'
key: ${{ runner.os }}-build-${{ matrix.node }}-${{ env.cache-name }}-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
Expand All @@ -75,11 +87,82 @@ jobs:
- name: Build CLI
run: yarn build:cli # Needed for CLI tests

test:
timeout-minutes: 60
name: Test (${{ matrix.os }} / node ${{ matrix.node }})
runs-on: ${{ matrix.os }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
continue-on-error: ${{ matrix.experimental }}
needs: [install]

strategy:
# we want to know if a test fails on a specific node version
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [18, 20]
experimental: [false]
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
# include:
# - os: windows-latest
# node: 16
# experimental: true

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- uses: actions/cache@v3
id: restore-node-modules
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}

- uses: actions/cache@v3
id: restore-build
env:
cache-name: cache-build
with:
path: ./*
key: ${{ runner.os }}-build-${{ matrix.node }}-${{ env.cache-name }}-${{ github.run_id }}

- name: Install project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile

- name: Store Playwright's Version
run: |
PLAYWRIGHT_VERSION=$(npx playwright --version | sed 's/Version //')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV

- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright Browsers
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: npx playwright install --with-deps

- name: Test
id: test
run: |
node -v
npm -v
yarn test --silent
yarn test --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }}
env:
SANITY_CI_CLI_AUTH_TOKEN: ${{ secrets.SANITY_CI_CLI_AUTH_TOKEN }}
GITHUB_SHARD_IDENTIFIER: ${{ matrix.shardIndex }}-${{ matrix.shardTotal }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ blob-report
.yarn
.yarnrc
.turbo
.yalc
yalc.lock

## Documentation Report
scripts/docs-report.md

3 changes: 0 additions & 3 deletions dev/starter-cra-studio/.depcheckignore.json

This file was deleted.

23 changes: 0 additions & 23 deletions dev/starter-cra-studio/.gitignore

This file was deleted.

70 changes: 0 additions & 70 deletions dev/starter-cra-studio/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions dev/starter-cra-studio/package.json

This file was deleted.

Binary file removed dev/starter-cra-studio/public/favicon.ico
Binary file not shown.
40 changes: 0 additions & 40 deletions dev/starter-cra-studio/public/index.html

This file was deleted.

Binary file removed dev/starter-cra-studio/public/logo192.png
Binary file not shown.
Binary file removed dev/starter-cra-studio/public/logo512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions dev/starter-cra-studio/public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions dev/starter-cra-studio/public/robots.txt

This file was deleted.

33 changes: 0 additions & 33 deletions dev/starter-cra-studio/src/Studio.js

This file was deleted.

9 changes: 0 additions & 9 deletions dev/starter-cra-studio/src/index.css

This file was deleted.

14 changes: 0 additions & 14 deletions dev/starter-cra-studio/src/index.js

This file was deleted.

Loading
Loading