From e0e5f2a7dda614d9cd71093eb714d56dbfa71b95 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Mon, 11 Jan 2021 21:55:25 +0100 Subject: [PATCH] Add branch info to browserstack runs (#935) --- .github/workflows/e2e.yml | 20 ++++++++++++++++---- README.md | 1 - browserstack.json | 4 ++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 42017d24c..d8bba2ae9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -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 diff --git a/README.md b/README.md index 6e48f5a64..366f26167 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ SPDX-License-Identifier: CC-BY-SA-4.0 ![e2e](https://github.com/hedgedoc/react-client/workflows/e2e/badge.svg) ![lint](https://github.com/hedgedoc/react-client/workflows/lint/badge.svg) ![lint](https://github.com/hedgedoc/react-client/workflows/lint/badge.svg) -[![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=UFp1ZTdJdHVMZTF2UEZCcmdZR1QwQzJSSVQyZHJMNFZQcVovRm5XbVVBWT0tLTNpWlFPV0hhai9vSzFTQ2xha3JzbVE9PQ==--b54f8953f94b792980183a46a302ebc15647f0ef)](https://automate.browserstack.com/public-build/UFp1ZTdJdHVMZTF2UEZCcmdZR1QwQzJSSVQyZHJMNFZQcVovRm5XbVVBWT0tLTNpWlFPV0hhai9vSzFTQ2xha3JzbVE9PQ==--b54f8953f94b792980183a46a302ebc15647f0ef) This is the new, improved and better looking frontend for HedgeDoc 2.0. Our goal is to recreate the current frontend in react and to improve it. diff --git a/browserstack.json b/browserstack.json index 22601713f..160ec158d 100644 --- a/browserstack.json +++ b/browserstack.json @@ -18,8 +18,8 @@ "run_settings": { "cypress_version": "6.2.0", "cypress_config_file": "./cypress.json", - "project_name": "HedgeDoc", - "build_name": "build-name", + "build_name": "", + "project_name": "hedgedoc/react-client", "exclude": [], "parallels": "5", "npm_dependencies": {