Skip to content

Commit

Permalink
test: setup e2e tests to run in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
umaranis committed May 14, 2022
1 parent a23fd40 commit 3649c32
Show file tree
Hide file tree
Showing 3 changed files with 569 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Svelte Lexical Tests

on:
push:
branches:
- master
paths-ignore:
- 'demos/plaintext-editor/**'
- 'demos/richtext-editor/**'
- 'demos/richtext-editor-basic/**'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'demos/plaintext-editor/**'
- 'demos/richtext-editor/**'
- 'demos/richtext-editor-basic/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
e2e-windows:
runs-on: windows-latest
strategy:
matrix:
node-version: [16.8]
browser: ['chromium', 'firefox']
editor-mode: ['rich-text', 'plain-text']
events-mode: ['legacy-events', 'modern-events']
env:
CI: true
E2E_EDITOR_MODE: ${{ matrix.editor-mode }}
E2E_EVENTS_MODE: ${{ matrix.events-mode }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@8
# - uses: actions/cache@v3
# id: cache
# with:
# path: |
# node_modules
# C:\Users\runneradmin\AppData\Local\ms-playwright
# key: ${{ runner.os }}-v${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }}
# - name: Install dependencies
# if: steps.cache.outputs.cache-hit != 'true'
- run: npm ci
- name: Download browsers
run: npx playwright install
- run: npm run test-e2e-ci:${{ matrix.browser }}
- name: Upload Artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: Test Results
path: test-results/
retention-days: 7
12 changes: 11 additions & 1 deletion demos/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public --no-clear"
"start": "sirv public --no-clear",
"test-e2e-ci:chromium": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci 4000 test-e2e:chromium",
"test-e2e-ci:firefox": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci 4000 test-e2e:firefox",
"test-e2e-ci:webkit": "cross-env E2E_PORT=4000 start-server-and-test prepare-ci 4000 test-e2e:webkit",
"prepare-ci": "npm run build && serve public -l 4000",
"test-e2e:chromium": "cross-env E2E_BROWSER=chromium playwright test --project=\"chromium\"",
"test-e2e:firefox": "cross-env E2E_BROWSER=firefox playwright test --project=\"firefox\"",
"test-e2e:webkit": "cross-env E2E_BROWSER=webkit playwright test --project=\"webkit\""
},
"devDependencies": {
"@playwright/test": "^1.21.1",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-node-resolve": "^11.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.13.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
Expand All @@ -21,6 +29,8 @@
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-svelte": "^7.0.0",
"rollup-plugin-terser": "^7.0.0",
"serve": "^13.0.2",
"start-server-and-test": "^1.14.0",
"uuid": "^8.3.2"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 3649c32

Please sign in to comment.