-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
91 lines (89 loc) · 2.45 KB
/
Copy pathdatabase.yml
File metadata and controls
91 lines (89 loc) · 2.45 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
name: Database
on:
pull_request:
paths: &paths
- "**.py"
- "**.toml"
- "**.lock"
- "data/**"
- "Resources/docker/app/Dockerfile"
- "Resources/nginx/**"
- "docker-compose**"
- Makefile
- .github/actions/setup-uv/action.yml
- .github/workflows/database.yml
push:
branches-ignore:
- master
- staging
paths: *paths
jobs:
csv:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Lint
run: |
set -e
curl -sSL https://github.com/Clever/csvlint/releases/download/v0.3.0/csvlint-v0.3.0-linux-amd64.tar.gz | tar xz --strip-components=1
for filename in data/v2/csv/*.csv; do
echo "$filename"
./csvlint -lazyquotes "$filename" # TODO: remove lazyquotes when https://github.com/Clever/csvlint/issues/45 will be addressed
done
openapi:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup uv
uses: ./.github/actions/setup-uv
- name: Generate OpenAPI schema
run: |
make install-base
make openapi-generate
sqlite:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup uv
uses: ./.github/actions/setup-uv
with:
python-version: ${{ matrix.python-version }}
- name: Start pokeapi
run: |
make install-base
make setup
make build-db
nohup make serve &
sleep 3
- name: Dump DB
run: stat db.sqlite3
- name: Test data
run: curl -Ss http://localhost:8000/api/v2/pokemon/1/ | grep -q 'bulbasaur'
postgres:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
- name: Build and start services
run: make docker-dev-up
- name: Run migrations and build database
run: |
make docker-migrate
make docker-build-db
- name: Dump DB
run: make docker-dump-db
- name: Import database
run: make docker-restore-db
- name: Test data
run: curl -Ss http://localhost/api/v2/pokemon/1/ | grep -q 'bulbasaur'