Skip to content

Commit

Permalink
ci: Update yaml-playground build & BrowserStack tests (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Feb 25, 2024
1 parent 8d8cfb7 commit 5ba73d1
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 12 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/browsers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,31 @@ jobs:
with: { submodules: true }
- uses: actions/setup-node@v4
with: { node-version: 20 }
- name: Cache BrowserStackLocal
uses: actions/cache@v4
- uses: browserstack/github-actions/setup-env@master
with:
path: ~/.browserstack
key: bsl-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
bsl-${{ runner.os }}-
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
project-name: yaml
- uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
local-identifier: random

- run: npm ci
- run: npm run build:browser
- name: Playground setup
working-directory: ./playground
run: npm ci
- name: Playground build
working-directory: ./playground
run: npm run build
- run: npx http-server site &
working-directory: ./playground

- name: Run tests on BrowserStack
- run: npx browserstack-node-sdk jest
working-directory: ./playground
run: npm test
env:
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}

- uses: browserstack/github-actions/setup-local@master
if: always()
with:
local-testing: stop
37 changes: 37 additions & 0 deletions .github/workflows/update-playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Update playground

on:
- workflow_dispatch

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with: { submodules: true }
- uses: actions/setup-node@v4
with: { node-version: 20 }
- run: npm ci
- run: npm run build:browser
- name: Playground setup
working-directory: ./playground
run: npm ci
- name: Playground build
working-directory: ./playground
run: npm run build

- uses: actions/checkout@v4
with:
repository: eemeli/yaml-playground
ref: gh-pages
path: ./gh-pages
- run: rm gh-pages/*
- run: cp playground/site/* gh-pages/

- name: git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- run: git add . && git commit -m 'Update playground' && git push
working-directory: ./gh-pages

0 comments on commit 5ba73d1

Please sign in to comment.