Skip to content

Fix HMR in React Framework #4105

Fix HMR in React Framework

Fix HMR in React Framework #4105

Workflow file for this run

name: CI Checks
# run this workflow on specific events in github
on:
# pull requests to master
pull_request:
paths:
- '**'
# every commit on master
push:
branches:
- 'main'
env:
# Playwright uses this env var for the browser install path. See:
# https://playwright.dev/docs/ci#directories-to-cache
# It makes most sense to default this to something cross-platform
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/ms-playwright
jobs:
format:
name: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Check prettier
run: pnpm run format:check
- name: Check lint
run: pnpm run lint
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build packages
run: pnpm run compile
- name: Tests
run: pnpm run tests
verify_create:
name: Verify Create
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: houdini
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: cd houdini && pnpm install
- name: Build packages
run: cd houdini && pnpm run compile
- name: Checkout template
uses: actions/checkout@v4
with:
repository: sveltejs/kit
path: kit
- name: Extract Template
run: mv kit/packages/create-svelte/templates/default project
- name: Run init
run: cd project && node ../houdini/packages/houdini/build/cmd-esm/index.js init -y
e2e_tests:
name: End-to-End Tests
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
framework: [e2e-svelte, e2e-kit]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
# pnpm
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ matrix.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ matrix.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
# Playwright
# Use Playwright version as part of the cache key
# AFAIK this is a x-platform way to get your installed Playwright version.
# Be sure to be diligent in specifying ^, ~, or locked versions.
- run: |
echo "PLAYWRIGHT_VERSION=$(node -e "process.stdout.write(require('@playwright/test/package.json').version)")" >> $GITHUB_OUTPUT
id: playwright-version
- uses: actions/cache@v3
id: playwright-cache
with:
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
- run: pnpm playwright install
if: steps.playwright-cache.outputs.cache-hit != 'true'
# Run tests
- name: Build packages
run: pnpm run compile
- name: End-to-End Tests ${{ matrix.framework }}
run: pnpm run --filter ${{ matrix.framework }} build && pnpm --filter ${{ matrix.framework }} tests
e2e_sveltekit_linter:
name: End-to-End Linter
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.17.0
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 8
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build Package
run: pnpm run build
- name: Build kit assets
run: pnpm --filter e2e-kit run build
# needs to run after build & houdini generate
- name: End-to-End lint
run: pnpm --filter e2e-kit run lint
- name: End-to-End check
run: pnpm --filter e2e-kit run check