Skip to content

Commit 5ba73d1

Browse files
authored
ci: Update yaml-playground build & BrowserStack tests (#524)
1 parent 8d8cfb7 commit 5ba73d1

File tree

3 files changed

+57
-12
lines changed

3 files changed

+57
-12
lines changed

.github/workflows/browsers.yml

+19-11
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,31 @@ jobs:
1313
with: { submodules: true }
1414
- uses: actions/setup-node@v4
1515
with: { node-version: 20 }
16-
- name: Cache BrowserStackLocal
17-
uses: actions/cache@v4
16+
- uses: browserstack/github-actions/setup-env@master
1817
with:
19-
path: ~/.browserstack
20-
key: bsl-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
21-
restore-keys: |
22-
bsl-${{ runner.os }}-
18+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
19+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
20+
project-name: yaml
21+
- uses: browserstack/github-actions/setup-local@master
22+
with:
23+
local-testing: start
24+
local-identifier: random
2325

2426
- run: npm ci
2527
- run: npm run build:browser
2628
- name: Playground setup
2729
working-directory: ./playground
2830
run: npm ci
31+
- name: Playground build
32+
working-directory: ./playground
33+
run: npm run build
34+
- run: npx http-server site &
35+
working-directory: ./playground
2936

30-
- name: Run tests on BrowserStack
37+
- run: npx browserstack-node-sdk jest
3138
working-directory: ./playground
32-
run: npm test
33-
env:
34-
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
35-
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
39+
40+
- uses: browserstack/github-actions/setup-local@master
41+
if: always()
42+
with:
43+
local-testing: stop
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Update playground
2+
3+
on:
4+
- workflow_dispatch
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v4
12+
with: { submodules: true }
13+
- uses: actions/setup-node@v4
14+
with: { node-version: 20 }
15+
- run: npm ci
16+
- run: npm run build:browser
17+
- name: Playground setup
18+
working-directory: ./playground
19+
run: npm ci
20+
- name: Playground build
21+
working-directory: ./playground
22+
run: npm run build
23+
24+
- uses: actions/checkout@v4
25+
with:
26+
repository: eemeli/yaml-playground
27+
ref: gh-pages
28+
path: ./gh-pages
29+
- run: rm gh-pages/*
30+
- run: cp playground/site/* gh-pages/
31+
32+
- name: git config
33+
run: |
34+
git config --global user.name "github-actions[bot]"
35+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
36+
- run: git add . && git commit -m 'Update playground' && git push
37+
working-directory: ./gh-pages

0 commit comments

Comments
 (0)