-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (113 loc) · 3.38 KB
/
Copy pathci.yml
File metadata and controls
120 lines (113 loc) · 3.38 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
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
configuration:
name: Configuration and secrets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- run: python -m pip install --disable-pip-version-check PyYAML==6.0.2
- run: python scripts/ci/validate_config.py
- run: docker compose config --quiet
- run: scripts/ci/check-secrets.sh
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
python:
name: Python quality gates
runs-on: ubuntu-latest
services:
postgis:
image: postgis/postgis:17-3.5
env:
POSTGRES_DB: seekandscore_test
POSTGRES_USER: seekandscore
POSTGRES_PASSWORD: seekandscore
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U seekandscore -d seekandscore_test"
--health-interval 5s
--health-timeout 5s
--health-retries 20
redis:
image: redis:7.4-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 20
env:
APP_ENV: test
DATABASE_URL: postgresql+psycopg://seekandscore:seekandscore@localhost:5432/seekandscore_test
REDIS_URL: redis://localhost:6379/15
DATASET_MODE: synthetic
INGESTION_ENABLED: "false"
OUTREACH_MODE: disabled
OUTREACH_SEND_ENABLED: "false"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v6
with:
version: "0.8.13"
enable-cache: true
- run: uv sync --frozen --group dev
- run: uv run ruff check python services tests/backend migrations
- run: uv run ruff format --check python services tests/backend migrations
- run: uv run mypy python services
- run: uv run pytest tests/backend
- run: uv run python -m seekandscore.db.migrate upgrade
web:
name: Web quality gates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10.2.1
- uses: actions/setup-node@v4
with:
node-version: "22.14.0"
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm check
containers:
name: Container build (${{ matrix.name }})
runs-on: ubuntu-latest
needs: [configuration, python, web]
strategy:
fail-fast: false
matrix:
include:
- name: api
dockerfile: infra/docker/api.Dockerfile
- name: worker
dockerfile: infra/docker/worker.Dockerfile
- name: web
dockerfile: infra/docker/web.Dockerfile
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: false
tags: seekandscore/${{ matrix.name }}:ci
cache-from: type=gha,scope=${{ matrix.name }}
cache-to: type=gha,mode=max,scope=${{ matrix.name }}