Skip to content

Commit 4f1948d

Browse files
authored
Merge pull request #4 from asteroidai/sync-upstream
Sync upstream
2 parents fb1d6d5 + 3a5c98e commit 4f1948d

File tree

141 files changed

+11663
-4447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+11663
-4447
lines changed

.github/workflows/ci.yml

Lines changed: 46 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- name: Use Node.js 18
14+
- name: Use Node.js 20
1515
uses: actions/setup-node@v4
1616
with:
17-
node-version: '18'
17+
node-version: '20'
1818
cache: 'npm'
1919
- name: Install dependencies
2020
run: npm ci
@@ -28,15 +28,14 @@ jobs:
2828
strategy:
2929
fail-fast: false
3030
matrix:
31-
os: [ubuntu-latest, macos-latest, windows-latest]
31+
os: [ubuntu-latest, macos-15, windows-latest]
3232
runs-on: ${{ matrix.os }}
3333
steps:
3434
- uses: actions/checkout@v4
35-
- name: Use Node.js 18
35+
- name: Use Node.js 20
3636
uses: actions/setup-node@v4
3737
with:
38-
# https://github.com/microsoft/playwright-mcp/issues/344
39-
node-version: '18.19'
38+
node-version: '20'
4039
cache: 'npm'
4140
- name: Install dependencies
4241
run: npm ci
@@ -55,10 +54,10 @@ jobs:
5554
runs-on: ubuntu-latest
5655
steps:
5756
- uses: actions/checkout@v4
58-
- name: Use Node.js 18
57+
- name: Use Node.js 20
5958
uses: actions/setup-node@v4
6059
with:
61-
node-version: '18'
60+
node-version: '20'
6261
cache: 'npm'
6362
- name: Install dependencies
6463
run: npm ci
@@ -83,3 +82,42 @@ jobs:
8382
npm run test -- --project=chromium-docker
8483
env:
8584
MCP_IN_DOCKER: 1
85+
86+
test_extension:
87+
strategy:
88+
fail-fast: false
89+
runs-on: macos-latest
90+
defaults:
91+
run:
92+
working-directory: ./extension
93+
steps:
94+
- uses: actions/checkout@v4
95+
- name: Use Node.js 20
96+
uses: actions/setup-node@v4
97+
with:
98+
node-version: '20' # crypto.randomUUID(); stalls in v18.20.8
99+
cache: 'npm'
100+
- name: Install dependencies
101+
run: npm ci
102+
- name: Build extension
103+
run: npm run build
104+
- name: Upload artifact
105+
uses: actions/upload-artifact@v4
106+
with:
107+
name: extension
108+
path: ./extension/dist
109+
retention-days: 7
110+
- name: Install and build MCP server
111+
run: |
112+
cd ..
113+
npm ci
114+
npm run build
115+
npx playwright install chromium
116+
- name: Run tests
117+
run: |
118+
if [[ "$(uname)" == "Linux" ]]; then
119+
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test
120+
else
121+
npm run test
122+
fi
123+
shell: bash
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
contents: read
24+
25+
# You can define any steps you want, and they will run before the agent starts.
26+
# If you do not check out your code, Copilot will do this for you.
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "18.19"
35+
cache: "npm"
36+
37+
- name: Install JavaScript dependencies
38+
run: npm ci
39+
40+
- name: Playwright install
41+
run: npx playwright install --with-deps
42+
43+
- name: Build
44+
run: npm run build

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- name: Login to ACR
4545
run: az acr login --name playwright
4646
- name: Build and push Docker image
47+
id: build-push
4748
uses: docker/build-push-action@v6
4849
with:
4950
context: .
@@ -53,3 +54,45 @@ jobs:
5354
tags: |
5455
playwright.azurecr.io/public/playwright/mcp:${{ github.event.release.tag_name }}
5556
playwright.azurecr.io/public/playwright/mcp:latest
57+
- uses: oras-project/setup-oras@v1
58+
- name: Set oras tags
59+
run: |
60+
attach_eol_manifest() {
61+
local image="$1"
62+
local today=$(date -u +'%Y-%m-%d')
63+
# oras is re-using Docker credentials, so we don't need to login.
64+
# Following the advice in https://portal.microsofticm.com/imp/v3/incidents/incident/476783820/summary
65+
oras attach --artifact-type application/vnd.microsoft.artifact.lifecycle --annotation "vnd.microsoft.artifact.lifecycle.end-of-life.date=$today" $image
66+
}
67+
# for each tag, attach the eol manifest
68+
for tag in $(echo ${{ steps.build-push.outputs.metadata['image.name'] }} | tr ',' '\n'); do
69+
attach_eol_manifest $tag
70+
done
71+
72+
package-extension:
73+
runs-on: ubuntu-latest
74+
permissions:
75+
contents: write # Needed to upload release assets
76+
steps:
77+
- uses: actions/checkout@v4
78+
- uses: actions/setup-node@v4
79+
with:
80+
node-version: 20
81+
cache: 'npm'
82+
- name: Install extension dependencies
83+
working-directory: ./extension
84+
run: npm ci
85+
- name: Build extension
86+
working-directory: ./extension
87+
run: npm run build
88+
- name: Package extension
89+
working-directory: ./extension
90+
run: |
91+
cd dist
92+
zip -r ../playwright-mcp-extension-${{ github.event.release.tag_name }}.zip .
93+
cd ..
94+
- name: Upload extension to release
95+
env:
96+
GITHUB_TOKEN: ${{ github.token }}
97+
run: |
98+
gh release upload ${{github.event.release.tag_name}} ./extension/playwright-mcp-extension-${{ github.event.release.tag_name }}.zip

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
lib/
2+
dist/
23
node_modules/
34
test-results/
45
playwright-report/
56
.vscode/mcp.json
6-
77
.idea
88
.DS_Store
9+
.env
10+
sessions/

0 commit comments

Comments
 (0)