Repository navigation
125 lines (106 loc) · 3.02 KB
/
Copy pathci.yml
File metadata and controls
125 lines (106 loc) · 3.02 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
120
121
122
123
124
125
name: CI
on:
push:
branches:
- develop
- 'feature/**'
pull_request:
branches:
- develop
- 'feature/**'
workflow_call:
inputs:
full:
description: 'Run full OS x Node matrix'
required: false
type: boolean
default: false
jobs:
compute-matrix:
name: Compute matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
name_suffix: ${{ steps.set.outputs.name_suffix }}
steps:
- id: set
run: |
if [[ "${{ inputs.full }}" == "true" ]]; then
echo 'matrix={"os":["ubuntu-latest"],"node":[22]}' >> "$GITHUB_OUTPUT"
echo 'name_suffix=(full matrix)' >> "$GITHUB_OUTPUT"
else
echo 'matrix={"os":["ubuntu-latest"],"node":[22]}' >> "$GITHUB_OUTPUT"
echo 'name_suffix=' >> "$GITHUB_OUTPUT"
fi
testing:
name: Testing ${{ needs.compute-matrix.outputs.name_suffix }}
needs: compute-matrix
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.compute-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure git EOL (Windows)
if: runner.os == 'Windows'
run: |
git config core.autocrlf false
git config core.eol lf
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
- name: Typecheck component tests
run: npm run typecheck:tests
- name: Test
run: npm run test:ci
- name: Build Types
run: npm run build:types
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-node${{ matrix.node }}
path: coverage
browser:
name: Extension integration and browsers
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: |
package-lock.json
tests/fixtures/shadow-dom/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install fixture dependencies
run: npm run test:install
- name: Install browsers
run: npx playwright install --with-deps chromium firefox
- name: Test extension builds and browser behavior
run: npm run test:e2e
- name: Upload browser diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: browser-results
path: test-results
retention-days: 14