-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
99 lines (94 loc) · 2.87 KB
/
migrations.yml
File metadata and controls
99 lines (94 loc) · 2.87 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
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Migrations
on:
push:
branches-ignore:
- renovate/**
- weblate
- dependabot/**
- copilot/**
- codex/**
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.4-alpine@sha256:96d56f7f57c6aacd1fcb908bc83b345ec5f83231ee486dd66a1baadce274db88
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.14
- 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: Migrate from 2026.5
run: ./ci/run-migrate 2026.5
- name: Coverage
run: |
uv run coverage combine
uv run coverage xml
- uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
token: ${{secrets.CODECOV_TOKEN}} # zizmor: ignore[secrets-outside-env]
flags: migrations
name: Migrations postgresql