-
Notifications
You must be signed in to change notification settings - Fork 17
83 lines (71 loc) · 2.68 KB
/
Copy pathbrowserstack.yml
File metadata and controls
83 lines (71 loc) · 2.68 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
name: Browserstack
on:
pull_request:
types: [opened, synchronize, unlabeled]
push:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
if: "${{ github.event_name != 'pull_request' || github.event.action != 'unlabeled' || github.event.label.name == 'skip: browserstack' }}"
strategy:
matrix:
node-version: [16.16]
steps:
- name: Check BrowserStack skip label
id: browserstack
env:
SKIP_BROWSERSTACK: "${{ github.event_name == 'pull_request' && 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: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Run npm ci
run: sudo npm ci
- 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 npm test with BrowserStack Local
if: steps.browserstack.outputs.skip != 'true'
run: npm 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: steps.browserstack.outputs.skip != 'true'
uses: "browserstack/github-actions/setup-local@master"
with:
local-testing: "stop"