-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (102 loc) · 2.9 KB
/
Copy pathci.yml
File metadata and controls
109 lines (102 loc) · 2.9 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
name: CI
on:
push:
branches: [master]
pull_request:
defaults:
run:
working-directory: asmita
jobs:
checks:
name: Lint, types, unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: asmita/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run type-check
- run: npm run prisma:validate
- run: npm run test
build:
name: Production build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: asmita/package-lock.json
- run: npm ci
- run: npm run build
env:
# Dummy values so the build never needs real secrets; runtime
# secrets live only in Vercel.
DATABASE_URL: postgresql://ci:ci@localhost:5432/ci
ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
JWT_SECRET: ci-only-secret
CSRF_SECRET: ci-only-secret
secret-scan:
name: Secret scanning (gitleaks)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
security-audit:
name: Dependency audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: asmita/package-lock.json
- run: npm ci
- run: npm run security:audit
e2e:
name: Playwright e2e (with Postgres)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: asmita
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/asmita
DIRECT_URL: postgresql://postgres:postgres@localhost:5432/asmita
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: asmita/package-lock.json
- run: npm ci
- run: npx prisma migrate deploy
- run: npx prisma db seed
- run: npx playwright install --with-deps chromium
- run: npx playwright test --project=chromium
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: asmita/playwright-report/
retention-days: 7