-
Notifications
You must be signed in to change notification settings - Fork 66
74 lines (62 loc) · 2.71 KB
/
Copy pathbrowserstack.yml
File metadata and controls
74 lines (62 loc) · 2.71 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
name: BrowserStack
on:
workflow_dispatch: # Manual trigger only
push:
branches: [main] # Run on merge to main
pull_request:
branches: [main]
types: [labeled] # Trigger by adding label 'browserstack'
# Least privilege: these jobs only read the repo. Any job needing more
# must elevate with its own job-level `permissions:` block.
permissions:
contents: read
jobs:
cross-browser:
name: Cross-Browser Tests
runs-on: ubuntu-latest
timeout-minutes: 15
# Dependabot PRs run without repo secrets; skip rather than fail.
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.11"
- name: Install dependencies
run: pip install flask pytest pytest-playwright requests browserstack-sdk
- name: Install Playwright browsers
run: python3 -m playwright install chromium
- name: Start ClawMetry server
run: |
OPENCLAW_GATEWAY_TOKEN=ci-test-token python3 dashboard.py --port 8900 --no-debug &
for i in $(seq 1 30); do
curl -sf -H "Authorization: Bearer ci-test-token" http://localhost:8900/api/health && echo "Server ready" && break
sleep 1
done
- name: Set up BrowserStack env
uses: browserstack/github-actions/setup-env@1ab56d9521ce20f4651bb5d9f3ef39c5ba54805a # master @ 2026-08-28
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: Start BrowserStack Local Tunnel
uses: browserstack/github-actions/setup-local@1ab56d9521ce20f4651bb5d9f3ef39c5ba54805a # master @ 2026-08-28
with:
local-testing: start
local-identifier: clawmetry-${{ github.run_id }}
- name: Run tests via BrowserStack SDK
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_LOCAL_IDENTIFIER: clawmetry-${{ github.run_id }}
CLAWMETRY_URL: http://localhost:8900
CLAWMETRY_TOKEN: ci-test-token
run: |
BUILD_NUMBER=${{ github.run_number }} browserstack-sdk python3 -m pytest tests/test_e2e_browserstack.py -v --tb=short
- name: Stop BrowserStack Local Tunnel
if: always()
uses: browserstack/github-actions/setup-local@1ab56d9521ce20f4651bb5d9f3ef39c5ba54805a # master @ 2026-08-28
with:
local-testing: stop
local-identifier: clawmetry-${{ github.run_id }}