0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-24 09:14:46 +01:00
posthog/.github/workflows/cypress-component.yml
Karl-Aksel Puulmann 4aa773139c
Measure metrics from insights in instance metrics (#4495)
* Send info on insights query timing + route to posthog

This will help with determining the root cause of our problems

* Capture information on "timeouts" correctly

previously every error on insights was reported as a timeout.

* WIP

* Solve typing issues within insightslogic

* WIP part 2

* Add graphs for insight load times

* Add tests for new routes

* PR review iteration

* Make instance_status POST available for all

* Do some cache busting
2021-05-27 12:48:11 +03:00

80 lines
3.2 KiB
YAML

name: Cypress Component
on:
- pull_request
jobs:
cypress-component:
name: Cypress component tests
runs-on: ubuntu-18.04
if: ${{ github.actor != 'posthog-contributions-bot[bot]' }}
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 14
- uses: actions/cache@v2
id: cypress-node-modules-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-cypress-node-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-cypress-node-modules
- name: Yarn install deps
if: steps.cypress-node-modules-cache.outputs.cache-hit != 'true'
run: |
yarn install --frozen-lockfile
- uses: actions/cache@v2
id: cypress-cache
with:
path: |
~/.cache/Cypress
**/node_modules/cypress
**/node_modules/cypress-terminal-report
**/node_modules/@cypress
key: ${{ runner.os }}-cypress-6.7.0-v1
- name: Install cypress
if: steps.cypress-cache.outputs.cache-hit != 'true'
run: |
yarn add cypress@6.7.0 cypress-terminal-report@2.1.0 @cypress/react@4.16.4 @cypress/webpack-preprocessor@5.7.0
- uses: actions/cache@v1
name: Setup Yarn build cache
id: yarn-build-cache
with:
path: frontend/dist
key: ${{ runner.os }}-yarn-build-${{ hashFiles('frontend/src/') }}
restore-keys: |
${{ runner.os }}-yarn-build-
- name: Yarn build
if: steps.yarn-build-cache.outputs.cache-hit != 'true'
run: |
yarn build
- name: Cypress run
uses: cypress-io/github-action@v2
with:
config-file: cypress.json
record: true
parallel: true
group: 'PostHog Component'
# We're already installing cypress above
# We have to install it separately otherwise the tests fail.
install: false
# We already install cypress separately, we don't need to install it again here
install-command: echo "no"
env:
# pass the Dashboard record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive test screenshots
uses: actions/upload-artifact@v1
with:
name: screenshots
path: cypress/screenshots
if: ${{ failure() }}