-
Notifications
You must be signed in to change notification settings - Fork 93
83 lines (69 loc) · 2.17 KB
/
ci-behavior.yml
File metadata and controls
83 lines (69 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Behavior Tests
permissions:
contents: read
on:
pull_request:
branches: [main]
paths:
- 'packages/superdoc/**'
- 'packages/layout-engine/**'
- 'packages/super-editor/**'
- 'packages/ai/**'
- 'packages/word-layout/**'
- 'packages/preset-geometry/**'
- 'tests/behavior/**'
- 'shared/**'
- '!**/*.md'
workflow_dispatch:
concurrency:
group: ci-behavior-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3]
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install --ignore-scripts
- name: Build SuperDoc
run: pnpm build
- name: Get Playwright version
id: pw
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
working-directory: tests/behavior
- name: Cache Playwright browsers
uses: actions/cache@v5
id: pw-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.pw.outputs.version }}
- name: Install Playwright browsers
if: steps.pw-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps chromium firefox webkit
working-directory: tests/behavior
- name: Install Playwright system deps
if: steps.pw-cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium firefox webkit
working-directory: tests/behavior
- name: Run behavior tests (shard ${{ matrix.shard }}/3)
run: pnpm exec playwright test --shard=${{ matrix.shard }}/3
working-directory: tests/behavior
validate:
if: always()
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Check results
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
exit 1
fi