-
-
Notifications
You must be signed in to change notification settings - Fork 704
117 lines (104 loc) · 2.93 KB
/
generate-openapi-schema.yml
File metadata and controls
117 lines (104 loc) · 2.93 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
name: Generate OpenAPI Schema
on:
push:
branches:
- master
paths:
- '**'
- '!.editorconfig'
- '!webview/**'
- '!website/**'
- '!.github/workflows/deploy-website.yaml'
- '!.github/workflows/build-webview.yaml'
- '!.github/workflows/build-balena-disk-image.yaml'
- '!.github/workflows/python-lint.yaml'
- '!.github/release.yml'
- '!.github/dependabot.yml'
- '!README.md'
- '!CONTRIBUTING.md'
- '!docs/**'
- '!bin/install.sh'
- '!bin/upgrade_containers.sh'
- '!tests/**'
- '!.cursor/**'
pull_request:
branches:
- master
paths:
- '**'
- '!.editorconfig'
- '!webview/**'
- '!website/**'
- '!.github/workflows/deploy-website.yaml'
- '!.github/workflows/build-webview.yaml'
- '!.github/workflows/build-balena-disk-image.yaml'
- '!.github/workflows/python-lint.yaml'
- '!.github/release.yml'
- '!.github/dependabot.yml'
- '!README.md'
- '!CONTRIBUTING.md'
- '!docs/**'
- '!bin/install.sh'
- '!bin/upgrade_containers.sh'
- '!tests/**'
- '!.cursor/**'
workflow_call:
jobs:
generate-openapi-schema:
runs-on: ubuntu-24.04
env:
COMPOSE_FILE: docker-compose.dev.yml
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: '0.9.17'
- name: Install dependencies
run: |
uv venv
uv pip install --group docker-image-builder
- name: Cache Docker layers
uses: actions/cache@v4
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-x86
restore-keys: |
${{ runner.os }}-x86
- name: Build Images
run: |
uv run python -m tools.image_builder \
--dockerfiles-only \
--disable-cache-mounts \
--environment=development
docker compose build
- name: Start the Containers
run: |
docker compose up -d
- name: Wait for server to be ready
run: |
for i in $(seq 1 30); do
if docker compose exec anthias-server python -c "import django" 2>/dev/null; then
echo "Server is ready"
break
fi
echo "Waiting for server... ($i/30)"
sleep 2
done
- name: Generate OpenAPI Schema
run: |
docker compose exec anthias-server \
./manage.py spectacular \
--format openapi-json \
--file anthias-api-schema.json
- name: Upload the OpenAPI Schema
uses: actions/upload-artifact@v4
with:
name: anthias-api-schema
path: anthias-api-schema.json