-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 2.23 KB
/
test.yaml
File metadata and controls
102 lines (85 loc) · 2.23 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
name: Test
on:
pull_request:
push:
branches:
- 'main'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
test:
name: Run pytest (all tests)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17.2
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: pyconkr_2025_test_db
ports:
- 45432:5432
options: >-
--health-cmd "pg_isready -U user -d pyconkr_2025_test_db"
--health-interval 5s
--health-timeout 5s
--health-retries 10
redis:
image: redis:alpine
ports:
- 46379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
ENV_PATH: ../envfile/.env.local
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
ignore-nothing-to-cache: true
- name: Install dependencies
run: uv sync
- name: Run pytest
working-directory: app
run: uv run pytest
shop-coverage:
name: Verify shop coverage is 100%
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17.2
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: pyconkr_2025_test_db
ports:
- 45432:5432
options: >-
--health-cmd "pg_isready -U user -d pyconkr_2025_test_db"
--health-interval 5s
--health-timeout 5s
--health-retries 10
redis:
image: redis:alpine
ports:
- 46379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
ignore-nothing-to-cache: true
- name: Install dependencies
run: uv sync
- name: Run shop coverage check (fails if <100%)
run: make local-test-cov-shop