Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update yaml-playground build & BrowserStack tests #524

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading