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

feat(core): visual regression #1045

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft
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
117 changes: 65 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,70 @@ env:

jobs:

Build:
name: Build Editor
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
- run: pnpm install
- run: pnpm build-editor
env:
NODE_OPTIONS: '--max_old_space_size=4096'
# Build:
# name: Build Editor
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: pnpm/action-setup@v2
# - run: pnpm install
# - run: pnpm build-editor
# env:
# NODE_OPTIONS: '--max_old_space_size=4096'

Test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
- run: pnpm install
- run: |
pnpm build-types # typecheck
pnpm coverage
env:
NODE_OPTIONS: '--max_old_space_size=4096'
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
# Test:
# name: Test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# node-version: [20.x]
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v3
# with:
# node-version: ${{ matrix.node-version }}
# - uses: pnpm/action-setup@v2
# - run: pnpm install
# - run: |
# pnpm build-types # typecheck
# pnpm coverage
# env:
# NODE_OPTIONS: '--max_old_space_size=4096'
# - uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true
# VisualTest:
# name: Visual Regression
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: pnpm/action-setup@v2
# - run: pnpm install
# - run: npx playwright install --with-deps chromium
# - run: pnpm test-ct

Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
- run: pnpm install
- name: ESLint
run: pnpm eslint src/ editor/
- name: Assert schemas are all up to date
run: |
pnpm schema
git diff --exit-code
# Lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: pnpm/action-setup@v2
# - run: pnpm install
# - name: ESLint
# run: pnpm eslint src/ editor/
# - name: Assert schemas are all up to date
# run: |
# pnpm schema
# git diff --exit-code
15 changes: 15 additions & 0 deletions .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Slash Command Dispatch
on:
issue_comment:
types: [created]
jobs:
slashCommandDispatch:
runs-on: ubuntu-latest
steps:
- name: Slash Command Dispatch
uses: peter-evans/slash-command-dispatch@v4
with:
token: ${{ secrets.PAT }}
commands: |
deploy
- run: echo "hello there"
4 changes: 2 additions & 2 deletions playwright-ct.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { defineConfig, devices } from '@playwright/experimental-ct-react';
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './src/core/',
testDir: './visual-regression/',
testMatch: '*.test.tsx',
/* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */
snapshotDir: './__snapshots__',
snapshotDir: './visual-regression/snapshots',
/* Maximum time one test can run for. */
timeout: 10 * 1000,
/* Run tests in files in parallel */
Expand Down
71 changes: 0 additions & 71 deletions src/core/gosling-component.test.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"src/index.ts",
"editor/index.tsx",
],
"include": ["src", "src/**/*.d.ts", "editor", "e2e"],
"include": ["src", "src/**/*.d.ts", "editor", "visual-regression"],
"exclude": [
"node_modules",
"public",
Expand Down
Loading