-
Notifications
You must be signed in to change notification settings - Fork 11
106 lines (88 loc) · 3.49 KB
/
Copy pathtests.yml
File metadata and controls
106 lines (88 loc) · 3.49 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
95
96
97
98
99
100
101
102
103
104
105
106
name: Tests (Desktop & Web)
on:
push:
branches:
- master
- dev
# Tests should always run on Pull Requests in order to catch regressions early
pull_request:
workflow_dispatch: # in case we need to regenerate test coverage
permissions: {}
jobs:
desktop-tests:
name: Desktop (Electron) tests
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
name: macOS
- os: windows-latest
name: Windows
- os: ubuntu-latest
name: Linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Cache VS Code test downloads
uses: actions/cache@v6
with:
key: neuropilot-tests-vscode-${{ github.repository }}-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
neuropilot-tests-vscode-${{ github.repository }}-${{ runner.os }}-
path: .vscode-test/
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version-file: ./package.json
cache: 'pnpm'
cache-dependency-path: './pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- name: Run desktop tests (Linux)
run: xvfb-run -a pnpm run test:desktop
if: runner.os == 'Linux'
- name: Run desktop tests (macOS/Windows)
run: pnpm run test:desktop
if: runner.os != 'Linux'
web-tests:
name: Web tests (browser matrix)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Cache VS Code web test downloads
uses: actions/cache@v6
with:
key: neuropilot-tests-vscode-web-v2-${{ github.repository }}-${{ runner.os }}
path: .vscode-test-web/
- name: Cache Playwright browsers
uses: actions/cache@v6
with:
key: neuropilot-playwright-v2-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: ~/.cache/ms-playwright
- name: Setup pnpm
uses: pnpm/action-setup@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version-file: ./package.json
cache: 'pnpm'
cache-dependency-path: './pnpm-lock.yaml'
- run: pnpm install --frozen-lockfile
- name: Ensure Playwright browsers are installed (Chromium, Firefox, WebKit)
run: pnpm exec playwright install --with-deps
- name: Build web extension and test bundle (browser)
run: pnpm run build:web && pnpm run test:web:browser:esbuild
- name: Run web tests (headless)
run: pnpm exec vscode-test-web --headless --browser=${{ matrix.browser }} --extensionDevelopmentPath=. --extensionTestsPath=out/web/test/browser.js test-playground