showdown/.github/workflows/browserstack.yml
Estevão Soares dos Santos 29538dda96 test: add commit msg as browserstack test name
This lines are just for testing purposes to see if everything in the msg is grabbed or only the first part of the message.
2022-03-27 22:33:06 +01:00

64 lines
1.9 KiB
YAML

name: 'BrowserStack Test'
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
jobs:
ubuntu-job:
name: 'BrowserStack Test on Ubuntu'
runs-on: ubuntu-latest
steps:
- name: '📦 Checkout the repository'
uses: actions/checkout@v2
- name: '🚚 Upgrade NPM'
run: npm install -g npm
- name: '⚙ Setup Node.js v17.x'
uses: actions/setup-node@v2
with:
node-version: 17.x
cache: 'npm'
- name: '📖 Get current package version'
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.1.0
- name: '📝 Print build version and commit msg'
run: echo ${{ steps.package-version.outputs.current-version}}-${{ github.run_id }} $COMMIT_MSG
- 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 }}
project-name: 'showdown'
build-name: ${{ steps.package-version.outputs.current-version}}-${{ github.run_id }}
- name: '🚇 BrowserStack Local Tunnel Setup' # Invokes the setup-local action
uses: browserstack/github-actions/setup-local@master
with:
local-testing: start
local-identifier: random
- name: '🚚 Install dependencies for CI'
run: npm ci
- name: '🏗 Building src files for testing'
run: npx grunt concat:test
- name: '✅ Running test on BrowserStack with Karma'
run: npx karma start karma.browserstack.js
- name: '🛑 BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection
uses: browserstack/github-actions/setup-local@master
with:
local-testing: stop