-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
85 lines (83 loc) · 2.63 KB
/
Copy pathdatabase.yml
File metadata and controls
85 lines (83 loc) · 2.63 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
name: Database
on:
pull_request:
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: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.19"
enable-cache: true
- 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: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.19"
enable-cache: true
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: |
docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d --build
- name: Run migrations and build database
run: |
make docker-migrate
make docker-build-db
- name: Dump DB
run: docker compose exec -T db pg_dump -U ash -Fc -N 'hdb_*' pokeapi > pokeapi.dump
- name: Drop and recreate database
run: |
docker compose exec -T db psql -U ash -d postgres -c "DROP DATABASE pokeapi WITH (FORCE);"
docker compose exec -T db psql -U ash -d postgres -c "CREATE DATABASE pokeapi;"
- name: Import database
run: docker compose exec -T db pg_restore -U ash -d pokeapi < pokeapi.dump
- name: Test data
run: curl -Ss http://localhost/api/v2/pokemon/1/ | grep -q 'bulbasaur'