Skip to content

Commit 9d69682

Browse files
committed
fix: CI db
1 parent 64d607c commit 9d69682

File tree

1 file changed

+105
-105
lines changed

1 file changed

+105
-105
lines changed

.github/workflows/checks.yml

Lines changed: 105 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,105 @@
1-
name: CI
2-
3-
on:
4-
workflow_call:
5-
workflow_dispatch:
6-
pull_request:
7-
branches:
8-
- main
9-
- dev
10-
11-
jobs:
12-
lint:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- name: Setup Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 21
20-
- name: Install pnpm
21-
run: |
22-
corepack enable
23-
corepack prepare pnpm@latest --activate
24-
- name: Install dependencies
25-
run: pnpm install
26-
- name: Lint
27-
run: pnpm lint
28-
29-
typecheck:
30-
runs-on: ubuntu-latest
31-
32-
steps:
33-
- uses: actions/checkout@v4
34-
- name: Setup Node.js
35-
uses: actions/setup-node@v3
36-
with:
37-
node-version: 21
38-
- name: Install pnpm
39-
run: |
40-
corepack enable
41-
corepack prepare pnpm@latest --activate
42-
- name: Install dependencies
43-
run: pnpm install
44-
- name: Typecheck
45-
run: pnpm typecheck
46-
47-
test:
48-
runs-on: ubuntu-latest
49-
services:
50-
postgres:
51-
image: pgvector/pgvector:0.8.0-pg17
52-
ports:
53-
- 5432:5432
54-
env:
55-
POSTGRES_USER: root
56-
POSTGRES_PASSWORD: root
57-
POSTGRES_DB: tatoo_test
58-
options: >-
59-
--health-cmd="pg_isready -U postgres"
60-
--health-interval=10s
61-
--health-timeout=5s
62-
--health-retries=5
63-
redis:
64-
image: redis:latest
65-
ports:
66-
- 6379:6379
67-
options: >-
68-
--health-cmd="redis-cli ping"
69-
--health-interval=10s
70-
--health-timeout=5s
71-
--health-retries=5
72-
steps:
73-
- uses: actions/checkout@v4
74-
- uses: pnpm/action-setup@v4
75-
with:
76-
run_install: false
77-
- name: Setup Node.JS
78-
uses: actions/setup-node@v3
79-
with:
80-
node-version: 20.14.0
81-
- name: Install dependencies
82-
run: pnpm install
83-
- name: Run tests
84-
run: pnpm run test
85-
86-
security:
87-
runs-on: ubuntu-latest
88-
if: github.event_name == 'pull_request'
89-
steps:
90-
- uses: actions/checkout@v4
91-
- name: Run Trivy vulnerability scanner
92-
uses: aquasecurity/trivy-action@master
93-
with:
94-
scan-type: 'fs'
95-
scan-ref: '.'
96-
format: 'sarif'
97-
output: 'trivy-results.sarif'
98-
continue-on-error: true
99-
100-
- name: Upload Trivy scan results
101-
uses: github/codeql-action/upload-sarif@v3
102-
if: always()
103-
with:
104-
sarif_file: 'trivy-results.sarif'
105-
continue-on-error: true
1+
name: CI
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
pull_request:
7+
branches:
8+
- main
9+
- dev
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 21
20+
- name: Install pnpm
21+
run: |
22+
corepack enable
23+
corepack prepare pnpm@latest --activate
24+
- name: Install dependencies
25+
run: pnpm install
26+
- name: Lint
27+
run: pnpm lint
28+
29+
typecheck:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Setup Node.js
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: 21
38+
- name: Install pnpm
39+
run: |
40+
corepack enable
41+
corepack prepare pnpm@latest --activate
42+
- name: Install dependencies
43+
run: pnpm install
44+
- name: Typecheck
45+
run: pnpm typecheck
46+
47+
test:
48+
runs-on: ubuntu-latest
49+
services:
50+
postgres:
51+
image: pgvector/pgvector:0.8.0-pg17
52+
ports:
53+
- 5432:5432
54+
env:
55+
POSTGRES_USER: root
56+
POSTGRES_PASSWORD: root
57+
POSTGRES_DB: app
58+
options: >-
59+
--health-cmd="pg_isready -U postgres"
60+
--health-interval=10s
61+
--health-timeout=5s
62+
--health-retries=5
63+
redis:
64+
image: redis:latest
65+
ports:
66+
- 6379:6379
67+
options: >-
68+
--health-cmd="redis-cli ping"
69+
--health-interval=10s
70+
--health-timeout=5s
71+
--health-retries=5
72+
steps:
73+
- uses: actions/checkout@v4
74+
- uses: pnpm/action-setup@v4
75+
with:
76+
run_install: false
77+
- name: Setup Node.JS
78+
uses: actions/setup-node@v3
79+
with:
80+
node-version: 20.14.0
81+
- name: Install dependencies
82+
run: pnpm install
83+
- name: Run tests
84+
run: pnpm run test
85+
86+
security:
87+
runs-on: ubuntu-latest
88+
if: github.event_name == 'pull_request'
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: Run Trivy vulnerability scanner
92+
uses: aquasecurity/trivy-action@master
93+
with:
94+
scan-type: 'fs'
95+
scan-ref: '.'
96+
format: 'sarif'
97+
output: 'trivy-results.sarif'
98+
continue-on-error: true
99+
100+
- name: Upload Trivy scan results
101+
uses: github/codeql-action/upload-sarif@v3
102+
if: always()
103+
with:
104+
sarif_file: 'trivy-results.sarif'
105+
continue-on-error: true

0 commit comments

Comments
 (0)