-
Notifications
You must be signed in to change notification settings - Fork 1
189 lines (167 loc) · 5.42 KB
/
Copy pathquality.yml
File metadata and controls
189 lines (167 loc) · 5.42 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Quality Checks
on:
push:
branches: ['feat/*', 'master']
pull_request:
branches: ['master']
jobs:
quality:
name: Lint, Format, Typecheck, Test
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
checks: write # required by mikepenz/action-junit-report to post check runs
pull-requests: write # required to post PR annotations
services:
postgres:
image: postgres:18
env:
POSTGRES_USER: sbf
POSTGRES_PASSWORD: sbf
POSTGRES_DB: sbf_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
mailpit:
image: axllent/mailpit
ports:
- 1025:1025
- 8025:8025
env:
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
options: >-
--health-cmd "wget -qO- http://localhost:8025/api/v1/messages || exit 1"
--health-interval 5s
--health-timeout 3s
--health-retries 10
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Format check
run: npx prettier --check .
- name: TypeScript typecheck
run: npm run typecheck
# Catches frontend calls whose verb no route accepts — that mismatch answers 404,
# not 405, so it reads like a wrong URL and is easy to miss in review.
- name: Route/method parity
run: npm run check:routes
env:
TZ: UTC
NODE_ENV: test
APP_KEY: test-app-key-for-ci-only-123456789
DB_HOST: 127.0.0.1
DB_PORT: 5432
DB_USER: sbf
DB_PASSWORD: sbf
DB_DATABASE: sbf_test
SESSION_DRIVER: memory
LOG_LEVEL: error
SMTP_HOST: localhost
SMTP_PORT: 1025
OIDC_ENABLED: 'false'
API_SECRET: test-api-secret
APP_URL: http://localhost:3334
- name: Run unit and functional tests
run: node ace test --no-color
env:
TZ: UTC
NODE_ENV: test
APP_KEY: test-app-key-for-ci-only-123456789
DB_HOST: 127.0.0.1
DB_PORT: 5432
DB_USER: sbf
DB_PASSWORD: sbf
DB_DATABASE: sbf_test
SESSION_DRIVER: memory
LOG_LEVEL: error
SMTP_HOST: localhost
SMTP_PORT: 1025
MAILPIT_API_URL: http://localhost:8025
OIDC_ENABLED: 'false'
API_SECRET: test-api-secret
APP_URL: http://localhost:3334
- name: Verify Japa JUnit report exists
if: always()
run: |
ls -la test-results || true
test -s test-results/junit-japa.xml
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
- name: Run Playwright E2E tests
run: npm run test:e2e
env:
MAILPIT_API_URL: http://localhost:8025
- name: Verify Playwright JUnit report exists
if: always()
run: |
ls -la test-results || true
test -s test-results/junit-e2e.xml
- name: Run Playwright Auth Matrix smoke tests (PR only)
if: github.event_name == 'pull_request'
run: npm run test:e2e:auth-matrix
env:
MAILPIT_API_URL: http://localhost:8025
- name: Verify Playwright Auth Matrix JUnit report exists (PR only)
if: always() && github.event_name == 'pull_request'
run: |
ls -la test-results || true
test -s test-results/junit-e2e-auth-matrix.xml
- name: Publish Japa test results
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'test-results/junit-japa.xml'
check_name: 'Japa Test Results'
require_tests: true
require_passed_tests: true
include_passed: true
detailed_summary: true
- name: Publish Playwright E2E results
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'test-results/junit-e2e.xml'
check_name: 'Playwright E2E Results'
require_tests: true
require_passed_tests: true
include_passed: true
detailed_summary: true
- name: Publish Playwright Auth Matrix results (PR only)
uses: mikepenz/action-junit-report@v4
if: always() && github.event_name == 'pull_request'
with:
report_paths: 'test-results/junit-e2e-auth-matrix.xml'
check_name: 'Playwright Auth Matrix Results'
require_tests: true
require_passed_tests: true
include_passed: true
detailed_summary: true
- name: Upload raw test result artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: |
test-results/junit-japa.xml
test-results/junit-e2e.xml
test-results/junit-e2e-auth-matrix.xml
playwright-report/**
test-results/**
playwright-artifacts/**
if-no-files-found: warn
retention-days: 14