-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (84 loc) · 3.04 KB
/
tests-e2e.yml
File metadata and controls
86 lines (84 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: 'Tests (E2E)'
on:
pull_request:
branches: [main, master]
types: [opened, synchronize, ready_for_review]
paths:
- '.github/workflows/tests-e2e.yml'
- 'package.json'
- 'packages/app/**'
- 'packages/constants/**'
- 'packages/db/**'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'tsconfig.json'
jobs:
cypress:
if: ${{ !github.event.pull_request.draft }}
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
browser: [chrome, firefox]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: '24'
cache: pnpm
- uses: browser-actions/setup-firefox@fcf821c621167805dd63a29662bd7cb5676c81a8 # v1.7.1
if: matrix.browser == 'firefox'
with:
firefox-version: latest
- name: Install dependencies
run: pnpm install --frozen-lockfile
env:
CYPRESS_INSTALL_BINARY: '0'
- name: Cache Cypress binary
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: ~/.cache/Cypress
key: cypress-binary-${{ runner.os }}-${{ runner.arch }}-${{ matrix.browser }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
cypress-binary-${{ runner.os }}-${{ runner.arch }}-
- name: Install Cypress binary if missing
working-directory: packages/app
run: pnpm exec cypress verify || pnpm exec cypress install
- name: Build app
run: pnpm build
env:
BLOB_CACHE_PREFIX: ci-cache
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
DATABASE_READONLY_URL: ${{ secrets.DATABASE_READONLY_URL }}
GITHUB_TOKEN: ${{ secrets.INFX_MAIN_PAT }}
- name: Run component tests
working-directory: packages/app
run: pnpm exec cypress run --component
env:
CI: true
- name: Run integration tests
uses: cypress-io/github-action@4c06c48f3ffea349b7189aa06dfcda47a9fa7b92 # v7.1.8
with:
working-directory: packages/app
install: false
start: pnpm start
wait-on: 'http://localhost:3000'
browser: ${{ matrix.browser }}
env:
BLOB_CACHE_PREFIX: ci-cache
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
CI: true
DATABASE_READONLY_URL: ${{ secrets.DATABASE_READONLY_URL }}
GITHUB_TOKEN: ${{ secrets.INFX_MAIN_PAT }}
- name: Upload Cypress artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: ${{ !cancelled() }}
with:
name: cypress-${{ matrix.browser }}-report
path: |
packages/app/cypress/screenshots/
retention-days: 1