forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (66 loc) · 2.13 KB
/
api.yml
File metadata and controls
70 lines (66 loc) · 2.13 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
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: API
on:
push:
branches-ignore:
- 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python
id: setup_python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
save-cache: ${{ github.ref == 'refs/heads/main' }}
cache-suffix: ${{ steps.setup_python.outputs.python-version }}
version: 0.10.6
- name: Start services
run: ./ci/services-up "$CI_DATABASE"
- name: Install apt dependencies
run: sudo ./ci/apt-install "$CI_DATABASE"
- 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 --frozen ./manage.py migrate --noinput --traceback
- name: Generate OpenAPI
run: |
echo "::add-matcher::.github/matchers/spectacular.json"
make -C docs update-openapi
echo "::remove-matcher owner=spectacular::"
- name: openapi-lint
run: npx @redocly/cli lint --format github-actions docs/specs/openapi.yaml
- name: Verify OpenAPI spec is up to date
run: git diff --exit-code
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
if: always()
with:
msg: 'chore(docs): update OpenAPI schema'