mirror of
https://github.com/WeblateOrg/weblate.git
synced 2026-07-27 22:46:38 +08:00
95 lines
2.8 KiB
YAML
Vendored
95 lines
2.8 KiB
YAML
Vendored
# Copyright © Michal Čihař <michal@weblate.org>
|
|
#
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
name: Migrations
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- renovate/**
|
|
- weblate
|
|
- dependabot/**
|
|
pull_request:
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
migrations:
|
|
runs-on: ubuntu-24.04
|
|
name: postgresql
|
|
env:
|
|
# This is needed for older versions to migrate, can be removed once migration from 5.17+ only is supported
|
|
CI_DATABASE: postgresql
|
|
CI_DB_PASSWORD: weblate
|
|
CI_DB_HOST: 127.0.0.1
|
|
CI_DB_PORT: '5432'
|
|
CI_SELENIUM: '1'
|
|
DJANGO_SETTINGS_MODULE: weblate.settings_test
|
|
UV_FROZEN: '1'
|
|
services:
|
|
database:
|
|
image: postgres:18.3-alpine@sha256:54451ecb8ab38c24c3ec123f2fd501303a3a1856a5c66e98cecf2460d5e1e9d7
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: weblate
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
- name: Install apt dependencies
|
|
run: sudo ./ci/apt-install
|
|
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
|
with:
|
|
enable-cache: true
|
|
# Do not share cache with tests as this uses python 3.11 for older versions
|
|
cache-suffix: multi
|
|
save-cache: ${{ github.ref == 'refs/heads/main' }}
|
|
version: 0.11.11
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
with:
|
|
python-version: |
|
|
3.11
|
|
3.13
|
|
- name: Install Python dependencies
|
|
run: ./ci/pip-install latest
|
|
- name: Check missing migrations
|
|
run: ./ci/run-checkmigrate
|
|
- name: Migrate from 5.10
|
|
run: ./ci/run-migrate 5.10
|
|
- name: Migrate from 5.11
|
|
run: ./ci/run-migrate 5.11
|
|
- name: Migrate from 5.12
|
|
run: ./ci/run-migrate 5.12
|
|
- name: Migrate from 5.13
|
|
run: ./ci/run-migrate 5.13
|
|
- name: Migrate from 5.14
|
|
run: ./ci/run-migrate 5.14
|
|
- name: Migrate from 5.15
|
|
run: ./ci/run-migrate 5.15
|
|
- name: Migrate from 5.16
|
|
run: ./ci/run-migrate 5.16
|
|
- name: Migrate from 5.17
|
|
run: ./ci/run-migrate 5.17
|
|
- name: Coverage
|
|
run: |
|
|
uv run coverage combine
|
|
uv run coverage xml
|
|
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
|
with:
|
|
token: ${{secrets.CODECOV_TOKEN}} # zizmor: ignore[secrets-outside-env]
|
|
flags: migrations
|
|
name: Migrations postgresql
|