-
Notifications
You must be signed in to change notification settings - Fork 5
134 lines (110 loc) · 4.19 KB
/
ci.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Continuous Integration
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: write
jobs:
# ––––––––––––––––––––––––––––––––––––––––––––––– #
# Lint & Format
# ––––––––––––––––––––––––––––––––––––––––––––––– #
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-node
- name: Run linter
run: npm run lint
- name: Check format
run: npm run format:check
# ––––––––––––––––––––––––––––––––––––––––––––––– #
# Test
# ––––––––––––––––––––––––––––––––––––––––––––––– #
test:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-node
- name: Run unit tests
run: npm run test
- name: Report coverage
if: success()
uses: davelosert/vitest-coverage-report-action@v2
# ––––––––––––––––––––––––––––––––––––––––––––––– #
# Build the application
# ––––––––––––––––––––––––––––––––––––––––––––––– #
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
env:
DOTENV_PRIVATE_KEY_DEVELOPMENT: ${{ secrets.DOTENV_PRIVATE_KEY_DEVELOPMENT }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.CI_GITHUB_PAT }}
- name: Setup environment
uses: ./.github/actions/setup-node
- name: Build application
run: npm run build
# ––––––––––––––––––––––––––––––––––––––––––––––– #
# End-to-end tests
# ––––––––––––––––––––––––––––––––––––––––––––––– #
e2e:
name: End-to-end tests
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
containers: [1, 2]
env:
DOTENV_PRIVATE_KEY_DEVELOPMENT: ${{ secrets.DOTENV_PRIVATE_KEY_DEVELOPMENT }}
DOTENV_PRIVATE_KEY_TEST: ${{ secrets.DOTENV_PRIVATE_KEY_TEST }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'true'
token: ${{ secrets.CI_GITHUB_PAT }}
- name: Debug submodule checkout
run: ls -la env-configs
- name: Setup environment
uses: ./.github/actions/setup-node
- name: Build application
run: npm run build
- name: Install Cypress
run: npm i cypress
- name: Execute Cypress tests
uses: cypress-io/github-action@v6
env:
CYPRESS_BASE_URL: 'http://localhost:4173'
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
COMMIT_INFO_MESSAGE: '${{ github.event.pull_request.title }} (#${{ github.event.pull_request.number }})'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ github.event_name }},e2e
install: false
start: npm run preview
wait-on: ${{ env.CYPRESS_BASE_URL }}
wait-on-timeout: 120
record: true
parallel: true
browser: chrome
spec: |
cypress/e2e/participant/default-tests/**/*.cy.js
cypress/e2e/partner-admin/default-tests/**/*.cy.js