forked from udecode/plate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set up Playwright * Test resizing tables * Comment out failing test * Add `g:playwright` script * Split ci-packages.yml into separate workflows * Linter fixes on e2e-examples * Fix type error * Debug GitHub workflow * Create install:playwright script * Debug * Exclude Playwright from Jest * Re-enable workflows * Update CONTRIBUTING * Fix resize row test * Fix typo
- Loading branch information
Showing
20 changed files
with
1,333 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Lint and typecheck | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
paths: | ||
- 'packages/**' | ||
- '.github/workflows/**' | ||
- '.yarnrc.yml' | ||
- 'yarn.lock' | ||
- '.prettier*' | ||
- '.eslint*' | ||
- 'jest.config.js' | ||
- 'lerna.json' | ||
- 'tsconfig.json' | ||
- 'config' | ||
- 'scripts' | ||
- 'patches' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- 'packages/**' | ||
- '.github/workflows/**' | ||
- '.yarnrc.yml' | ||
- 'yarn.lock' | ||
- '.prettier*' | ||
- '.eslint*' | ||
- 'jest.config.js' | ||
- 'lerna.json' | ||
- 'tsconfig.json' | ||
- 'config' | ||
- 'scripts' | ||
- 'patches' | ||
|
||
jobs: | ||
lint-typecheck: | ||
name: ${{ matrix.command }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
# Fetch all git history so that yarn workspaces --since can compare with the correct commits | ||
# @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches | ||
fetch-depth: 0 | ||
|
||
- name: Use Node.js 14.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.x | ||
|
||
# Why not using setup-node 2.2+ cache option (yet) ? | ||
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} | ||
restore-keys: | | ||
yarn-cache-folder- | ||
- name: Restore packages cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ github.workspace }}/.cache | ||
${{ github.workspace }}/**/tsconfig.tsbuildinfo | ||
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}- | ||
- name: Install | ||
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install | ||
|
||
# Build packages that have changed (--include & --since), assuming that | ||
# apps build are done already. Otherwise --from & --since | ||
- name: Build | ||
run: yarn g:build | ||
|
||
# Lint packages that have changed (--include & --since) | ||
- name: Lint | ||
run: yarn g:lint-changed | ||
|
||
# Typecheck packages that have changed (--include & --since) | ||
- name: Test | ||
run: yarn g:typecheck-changed |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Playwright tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
paths: | ||
- 'packages/**' | ||
- '.github/workflows/**' | ||
- '.yarnrc.yml' | ||
- 'yarn.lock' | ||
- '.prettier*' | ||
- '.eslint*' | ||
- 'jest.config.js' | ||
- 'lerna.json' | ||
- 'tsconfig.json' | ||
- 'config' | ||
- 'scripts' | ||
- 'patches' | ||
- 'playwright/**' | ||
- 'examples/apps/e2e-examples/**' | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- 'packages/**' | ||
- '.github/workflows/**' | ||
- '.yarnrc.yml' | ||
- 'yarn.lock' | ||
- '.prettier*' | ||
- '.eslint*' | ||
- 'jest.config.js' | ||
- 'lerna.json' | ||
- 'tsconfig.json' | ||
- 'config' | ||
- 'scripts' | ||
- 'patches' | ||
- 'playwright/**' | ||
- 'examples/apps/e2e-examples/**' | ||
|
||
jobs: | ||
test-e2e: | ||
name: ${{ matrix.command }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
# Fetch all git history so that yarn workspaces --since can compare with the correct commits | ||
# @link https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches | ||
fetch-depth: 0 | ||
|
||
- name: Use Node.js 14.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 14.x | ||
|
||
# Why not using setup-node 2.2+ cache option (yet) ? | ||
# see https://github.com/belgattitude/nextjs-monorepo-example/pull/369 | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v3 | ||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }} | ||
restore-keys: | | ||
yarn-cache-folder- | ||
- name: Restore packages cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{ github.workspace }}/.cache | ||
${{ github.workspace }}/**/tsconfig.tsbuildinfo | ||
key: ${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/**.[jt]sx?', 'packages/**.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-packages-cache-${{ hashFiles('**/yarn.lock') }}- | ||
- name: Install | ||
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install | ||
|
||
- name: Install Playwright dependencies | ||
run: yarn install:playwright | ||
|
||
# Build packages that have changed (--include & --since), assuming that | ||
# apps build are done already. Otherwise --from & --since | ||
- name: Build | ||
run: yarn g:build | ||
|
||
- name: Run Playwright tests | ||
run: yarn g:playwright | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"private": true, | ||
"name": "e2e-examples", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview", | ||
"start": "yarn build && yarn preview" | ||
}, | ||
"dependencies": { | ||
"examples": "link:../../src" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.27", | ||
"@types/react-dom": "^18.0.10", | ||
"@vitejs/plugin-react": "^3.1.0", | ||
"typescript": "^4.9.3", | ||
"vite": "^4.1.0" | ||
} | ||
} |
Oops, something went wrong.