mermaid/.github/workflows/e2e.yml

63 lines
1.9 KiB
YAML
Raw Normal View History

2021-01-28 22:39:17 +01:00
name: E2E
2021-01-28 22:36:18 +01:00
2023-07-02 06:33:31 +02:00
on:
push:
pull_request:
merge_group:
2021-01-28 22:36:18 +01:00
permissions:
contents: read
2021-01-28 22:36:18 +01:00
jobs:
build:
runs-on: ubuntu-latest
strategy:
2022-09-21 07:06:38 +02:00
fail-fast: false
2021-01-28 22:36:18 +01:00
matrix:
2022-10-10 14:13:50 +02:00
node-version: [18.x]
2022-09-21 07:12:27 +02:00
containers: [1, 2, 3, 4]
2021-01-28 22:36:18 +01:00
steps:
- uses: actions/checkout@v3
2021-01-28 22:36:18 +01:00
- uses: pnpm/action-setup@v2
# uses version from "packageManager" field in package.json
2022-09-21 07:06:38 +02:00
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
2021-01-28 22:36:18 +01:00
2022-09-21 07:06:38 +02:00
# Install NPM dependencies, cache them correctly
# and run all Cypress tests
- name: Cypress run
uses: cypress-io/github-action@v4
2023-01-15 20:53:42 +01:00
id: cypress
# If CYPRESS_RECORD_KEY is set, run in parallel on all containers
# Otherwise (e.g. if running from fork), we run on a single container only
if: ${{ ( env.CYPRESS_RECORD_KEY != '' ) || ( matrix.containers == 1 ) }}
2022-09-21 07:06:38 +02:00
with:
2023-06-17 14:24:13 +02:00
start: pnpm run dev:coverage
2022-09-21 07:06:38 +02:00
wait-on: 'http://localhost:9000'
# Disable recording if we don't have an API key
# e.g. if this action was run from a fork
record: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
parallel: ${{ secrets.CYPRESS_RECORD_KEY != '' }}
env:
2022-09-21 07:06:38 +02:00
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
2023-06-17 14:24:13 +02:00
VITEST_COVERAGE: true
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
if: steps.cypress.conclusion == 'success'
2023-06-17 14:04:19 +02:00
with:
2023-06-17 14:14:27 +02:00
files: coverage/cypress/lcov.info
2023-06-17 14:04:19 +02:00
flags: e2e
name: mermaid-codecov
fail_ci_if_error: true
verbose: true
2023-01-15 20:53:42 +01:00
- name: Upload Artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() && steps.cypress.conclusion == 'failure' }}
with:
name: error-snapshots
path: cypress/snapshots/**/__diff_output__/*