-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (90 loc) · 2.54 KB
/
backend.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
name: CI
permissions:
packages: read
contents: read
on:
workflow_call:
jobs:
backend-ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v4
- name: uv
id: setup-uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.5"
enable-cache: true
cache-dependency-glob: "./backend/uv.lock"
- name: uv sync
run: uv sync --frozen --group dev
- name: Cache authpage
id: cached-authpage
uses: actions/cache@v4
with:
key: authpage-${{ hashFiles('authpage') }}
path: backend/src/apiserver/resources/static/credentials
- uses: actions/setup-node@v4
if: ${{ steps.cached-authpage.outputs.cache-hit != 'true' }}
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: authpage/package-lock.json
- name: Build credentials
if: ${{ steps.cached-authpage.outputs.cache-hit != 'true' }}
run: |
npm install
npm run build
working-directory: ${{ github.workspace }}/authpage
- name: Pytest
run: uv run pytest
env:
QUERY_TEST: true
- name: Black
run: uv run black src tests
- name: Ruff
run: uv run ruff check src tests
- name: Cache mypy results
uses: actions/cache@v4
with:
key: mypy-${{ hashFiles('backend/uv.lock') }}
path: backend/.mypy_cache
- name: Mypy
run: uv run mypy
services:
postgres:
image: ghcr.io/dsav-dodeka/postgres:localdev
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
# These values must align with the config used by the tests in the repo
# The port is set in the image
env:
POSTGRES_PASSWORD: postpost
POSTGRES_USER: dodeka
options: >-
--health-cmd "pg_isready -p 3141"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3141:3141
redis:
image: ghcr.io/dsav-dodeka/redis:localdev
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
# These values must align with the config used by the tests in the repo
# The port is set in the image
env:
REDIS_PASSWORD: redisredis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379