Add branch info to browserstack runs (#935)

This commit is contained in:
Erik Michelson 2021-01-11 21:55:25 +01:00 committed by GitHub
parent cb5283b1bf
commit e0e5f2a7dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View file

@ -18,6 +18,14 @@ jobs:
- name: Check out repo
uses: actions/checkout@v2
- name: Get branch and commit
id: gitinfo
run: |
if [ -n "${{ github.event.pull_request.head.sha }}" ]; \
then echo "::set-output name=shapr::$(echo ${{ github.event.pull_request.head.sha }} | cut -c -7) - #${{ github.event.pull_request.number }}"; \
else echo "::set-output name=shapr::$(echo ${{ github.sha }} | cut -c -7)"; fi
echo "::set-output name=branch::${GITHUB_HEAD_REF:-main}"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
@ -36,6 +44,9 @@ jobs:
with:
node-version: 14
- name: Install sponge utility
run: sudo apt-get install -yqq moreutils
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
@ -45,6 +56,9 @@ jobs:
- name: Start http server
run: yarn serve:build &
- name: Set BrowserStack config values
run: jq '.run_settings.build_name = "${{ steps.gitinfo.outputs.shapr }} - ${{ steps.gitinfo.outputs.branch }}"' browserstack.json | sponge browserstack.json
- name: Set up BrowserStack environment
uses: 'browserstack/github-actions/setup-env@master'
with:
@ -57,10 +71,8 @@ jobs:
local-testing: start
local-identifier: random
- name: enable cypress videos
run: |
sudo apt-get install moreutils -yqq
jq '.video = true' cypress.json | sponge cypress.json
- name: Enable cypress videos
run: jq '.video = true' cypress.json | sponge cypress.json
- name: Run BrowserStack Tests
run: yarn run cy:browserstack