-
-
Notifications
You must be signed in to change notification settings - Fork 1k
62 lines (58 loc) · 1.71 KB
/
api.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
# Copyright © Michal Čihař <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: API
on:
push:
branches-ignore:
- deepsource-fix-**
- renovate/**
- weblate
pull_request:
permissions:
contents: read
jobs:
api-lint:
runs-on: ubuntu-24.04
name: API Lint
env:
CI_DATABASE: postgresql
CI_REDIS_HOST: 127.0.0.1
CI_REDIS_PORT: '60001'
CI_DB_PASSWORD: weblate
CI_DB_HOST: 127.0.0.1
CI_DB_PORT: '60000'
CI_SELENIUM: '1'
DJANGO_SETTINGS_MODULE: weblate.settings_test
PYTHONWARNINGS: default,ignore:unclosed:ResourceWarning
PYTHONUNBUFFERED: 1
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: ''
cache-suffix: '3.13'
- name: Start services
run: ./ci/services-up $CI_DATABASE
- name: Install apt dependencies
run: sudo ./ci/apt-install $CI_DATABASE
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Used versions
run: ./ci/print-versions
- name: Install Python dependencies
run: ./ci/pip-install latest
- name: Prepare database
run: ./ci/prepare-database
- name: Migrate database
run: uv run --no-sources ./manage.py migrate --noinput --traceback
- name: Generate OpenAPI
run: |
echo "::add-matcher::.github/matchers/spectacular.json"
uv run --no-sources ./manage.py spectacular --urlconf="weblate.api.urls" > weblate-openapi.yaml
echo "::remove-matcher owner=spectacular::"
- name: openapi-lint
run: npx @redocly/cli lint --format github-actions weblate-openapi.yaml