showdown/.github/workflows/browserstack.yml

58 lines
1.7 KiB
YAML
Raw Normal View History

name: 'BrowserStack Test'
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
ubuntu-job:
name: 'BrowserStack Test on Ubuntu'
runs-on: ubuntu-latest
steps:
- name: 'BrowserStack Env Setup' # Invokes the setup-env action
uses: browserstack/github-actions/setup-env@master
with:
username: ${{ secrets.BROWSERSTACK_USERNAME }}
access-key: ${{ secrets.BROWSERSTACK_ACCESSKEY }}
- name: 'BrowserStack Local Tunnel Setup' # Invokes the setup-local action
uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
local-identifier: random
# The next 3 steps are for building the web application to be tested and starting the web server on the runner environment
- name: 'Checkout the repository'
uses: actions/checkout@v2
- name: '🚚 Upgrade NPM'
run: npm install -g npm
2022-03-27 08:13:16 +08:00
- name: '🚚 install grunt-cli'
2022-03-27 08:15:12 +08:00
run: npm install -g grunt-cli --force
2022-03-27 08:13:16 +08:00
2022-03-27 08:17:58 +08:00
- name: '🚚 install karma globally'
run: npm install -g karma --force
- name: 'Use Node.js 17.x'
uses: actions/setup-node@v2
with:
node-version: 17.x
cache: 'npm'
2022-03-27 08:13:16 +08:00
- name: 'Install dependencies for CI'
run: npm ci
2022-03-27 08:08:22 +08:00
- name: 'Concatenate src files for testing'
run: grunt concat:test
- name: 'Running test on BrowserStack with Karma'
run: karma start karma.browserstack.js
- name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop