-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (97 loc) · 3.19 KB
/
Copy pathtest.yml
File metadata and controls
119 lines (97 loc) · 3.19 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
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Test
on:
push:
branches: [development]
pull_request:
branches: [development]
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
# TODO: Remove continue-on-error once #6 (flaky Windows test) is resolved
continue-on-error: ${{ matrix.os == 'windows-latest' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Log environment versions
run: |
echo "OS: ${{ matrix.os }}"
echo "Node: $(node --version)"
- name: Install dependencies
run: npm ci
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ${{ matrix.os == 'macos-latest' && '~/Library/Caches/ms-playwright' || (matrix.os == 'windows-latest' && '~/AppData/Local/ms-playwright' || '~/.cache/ms-playwright') }}
key: playwright-${{ matrix.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install chromium --with-deps
# Only needed on Linux - Windows/macOS have system deps pre-installed
- name: Install Playwright dependencies (Linux only)
if: steps.playwright-cache.outputs.cache-hit == 'true' && matrix.os == 'ubuntu-latest'
run: npx playwright install-deps chromium
- name: Build Chrome extension
run: npm run build:chrome
- name: Run tests
run: npm test
env:
API_CONTRACT_TEST_PAT: ${{ secrets.API_CONTRACT_TEST_PAT }}
- name: Upload Chrome extension
uses: actions/upload-artifact@v4
with:
name: chrome-extension-${{ matrix.os }}
path: build/bundle/*.zip
retention-days: 7
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.os }}
path: playwright-report/
retention-days: 7
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.os }}
path: test-results/
retention-days: 7
if-no-files-found: ignore
lint:
runs-on: macos-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build Firefox extension
run: npm run build:firefox
- name: Lint extension
run: npm run lint
- name: Upload Firefox extension
uses: actions/upload-artifact@v4
with:
name: firefox-extension
path: build/bundle/*.xpi
retention-days: 7