-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (89 loc) · 2.55 KB
/
Copy pathtest.yml
File metadata and controls
94 lines (89 loc) · 2.55 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
84
85
86
87
88
89
90
91
92
93
94
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
unit:
name: Canvas unit tests (Node ${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['20', '22']
defaults:
run:
working-directory: canvas
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
cache-dependency-path: canvas/package-lock.json
- run: npm ci
- name: Install tools/ deps (canvas tests shell out to tools/*.cjs)
working-directory: tools
run: npm install
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('canvas/package-lock.json') }}
- name: Install Playwright chromium (needed by render-engine tests)
run: npx playwright install --with-deps chromium
- run: npm test -- --run
build:
name: Canvas typecheck + build
runs-on: ubuntu-latest
defaults:
run:
working-directory: canvas
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: canvas/package-lock.json
- run: npm ci
- run: npm run build
tools:
name: CLI tools tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: tools
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install tools deps
run: npm install
- run: npm test
e2e:
name: Playwright e2e
runs-on: ubuntu-latest
defaults:
run:
working-directory: canvas
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: canvas/package-lock.json
- run: npm ci
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('canvas/package-lock.json') }}
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
# webServer config in playwright.config.ts boots `npm run dev` and
# waits for :5174 before running specs.
run: npx playwright test --reporter=line