-
Notifications
You must be signed in to change notification settings - Fork 17
85 lines (72 loc) · 2.76 KB
/
Copy pathbrowserstack.yml
File metadata and controls
85 lines (72 loc) · 2.76 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
name: Browserstack
on:
pull_request:
types: [opened, synchronize, unlabeled]
jobs:
build:
runs-on: ubuntu-latest
if: "${{ github.event.action != 'unlabeled' || github.event.label.name == 'skip: browserstack' }}"
steps:
- name: Check BrowserStack skip label
id: browserstack
env:
SKIP_BROWSERSTACK: "${{ github.event.action != 'unlabeled' && contains(github.event.pull_request.labels.*.name, 'skip: browserstack') }}"
run: echo "skip=${SKIP_BROWSERSTACK}" >> "$GITHUB_OUTPUT"
- name: "BrowserStack Env Setup"
if: steps.browserstack.outputs.skip != 'true'
uses: "browserstack/github-actions/setup-env@master"
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: "Start BrowserStackLocal Tunnel"
if: steps.browserstack.outputs.skip != 'true'
uses: "browserstack/github-actions/setup-local@master"
with:
local-testing: "start"
local-logging-level: "all-logs"
local-identifier: "random"
- uses: actions/checkout@v7
with:
ref: ${{ github.head_ref }}
set-safe-directory: "/github/workspace"
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: 11.17.0
- name: Use Node.js from .nvmrc
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Test BrowserStack matrix selection
run: pnpm run test:matrix
- name: Prettier check (report only, no writes or commits)
if: always()
run: |
{
echo "## Prettier formatting report"
echo ""
echo "CI does not write or commit formatting changes. Run \`npx prettier --write .\` locally to apply anything listed below."
echo ""
echo '```'
npx prettier --check . 2>&1 || true
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Run tests with BrowserStack Local
if: steps.browserstack.outputs.skip != 'true'
run: pnpm run build && node ./test/index.js
env:
CI: true
NODE_ENV: test
DEBUG: false
LOCATION: ${{ secrets.LOCATION }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
- name: "Stop BrowserStackLocal"
if: always() && steps.browserstack.outputs.skip != 'true'
uses: "browserstack/github-actions/setup-local@master"
with:
local-testing: "stop"