weblate/.github/workflows/api.yml
renovate[bot] 63384052e7
chore(deps): update dependency astral-sh/uv to v0.11.32 (#20835)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-07-25 06:54:27 +00:00

92 lines
2.8 KiB
YAML
Vendored

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: API
on:
push:
branches-ignore:
- renovate/**
- weblate
- dependabot/**
- copilot/**
- codex/**
pull_request:
permissions:
contents: read
jobs:
api-lint:
runs-on: ubuntu-24.04
name: API Lint
env:
CI_REDIS_HOST: 127.0.0.1
CI_REDIS_PORT: '6379'
CI_DB_PASSWORD: weblate
CI_DB_HOST: 127.0.0.1
CI_DB_PORT: '5432'
CI_SELENIUM: '1'
DJANGO_SETTINGS_MODULE: weblate.settings_test
PYTHONWARNINGS: default,ignore:unclosed:ResourceWarning
PYTHONUNBUFFERED: 1
services:
database:
image: postgres:18.4-alpine@sha256:9a8afca54e7861fd90fab5fdf4c42477a6b1cb7d293595148e674e0a3181de15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: weblate
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
cache:
image: valkey/valkey:9.1.1-alpine@sha256:ee91f7a174ac4d6a6b0685b3a60e321f0a9dbbb691f9b0e285be2ba1d1be8328
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
id: setup_python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: '3.14'
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
save-cache: ${{ github.ref == 'refs/heads/main' }}
cache-suffix: ${{ steps.setup_python.outputs.python-version }}
version: 0.11.32
- name: Install apt dependencies
run: sudo ./ci/apt-install
- 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'