Repository navigation
140 lines (122 loc) · 4.41 KB
/
Copy pathci.yml
File metadata and controls
140 lines (122 loc) · 4.41 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: CI
on:
push:
branches: [main]
pull_request:
# The weekly dependency update starts CI on its pull request this way.
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
HUSKY: '0'
jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: '22.23.2'
cache: npm
cache-dependency-path: |
package-lock.json
packages/runtimes/agent-device/package-lock.json
packages/runtimes/serve-emu/package-lock.json
- name: Install dependencies and device runtimes
run: |
npm ci --no-audit --no-fund
npm run vendor:agent-device
npm run vendor:serve-emu
# macOS-only paths skip themselves here; the release build runs the full suite on macOS.
- run: npm test
- run: npm run typecheck:telemetry
# Codex and Claude ship from main. Add mac here once it ships.
hosts:
name: Regression (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
target: [codex, claude]
container:
# Keep in step with @playwright/test in package.json.
image: mcr.microsoft.com/playwright:v1.64.1-noble
options: --user 1001
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- run: npm ci --no-audit --no-fund
- run: npm run build:hosts -- ${{ matrix.target }}
- run: npx playwright test -c tooling/hosts --project ${{ matrix.target }} --grep-invert @visual
- if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: regression-${{ matrix.target }}
path: |
playwright-report
test-results
retention-days: 7
visual:
name: Visual regression (codex)
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: mcr.microsoft.com/playwright:v1.64.1-noble
options: --user 1001
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- run: npm ci --no-audit --no-fund
- run: npm run build:hosts -- codex
- run: npx playwright test -c tooling/hosts --project codex --grep @visual
# The report shows expected, actual and diff images for each changed screenshot.
- if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: visual-regression
path: |
playwright-report
test-results
retention-days: 7
visual-report:
name: Visual diff comment
needs: visual
if: always() && (github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7
continue-on-error: true
with:
name: visual-regression
path: visual-regression
- name: Find the pull request
id: pr
env:
GH_TOKEN: ${{ github.token }}
NUMBER: ${{ github.event.pull_request.number }}
run: echo "number=${NUMBER:-$(gh pr list -R "$GITHUB_REPOSITORY" --head "$GITHUB_REF_NAME" --state open --json number -q '.[0].number')}" >> "$GITHUB_OUTPUT"
- name: Comment the screenshot diffs
if: steps.pr.outputs.number != ''
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ steps.pr.outputs.number }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
VISUAL_RESULT: ${{ needs.visual.result }}
run: node tooling/hosts/report-diffs.mjs visual-regression