Repository navigation
212 lines (201 loc) · 7.79 KB
/
Copy pathrundev.yml
File metadata and controls
212 lines (201 loc) · 7.79 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Development containers
on:
push:
branches:
- main
- stable
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
rundev:
runs-on: ubuntu-26.04-arm
timeout-minutes: 90
name: Test development Docker
env:
PYTHONUNBUFFERED: 1
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /tmp/cache/tesseract
key: tesseract-data
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
enable-cache: false
version: 0.13.10
- run: ./rundev.sh test weblate/checks/tests/test_chars_checks.py
- run: ./rundev.sh start
- run: ./rundev.sh wait
- run: ./rundev.sh check
- run: ./rundev.sh compilemessages
- name: Test asynchronous application journeys
run: ./rundev.sh application-test
- name: Run non-browser tests
run: ./rundev.sh test --exitfirst --ignore=weblate/trans/tests/test_selenium.py
- run: ./rundev.sh test weblate/checks/tests/test_chars_checks.py
- run: ./rundev.sh --all logs
if: always()
- run: ./rundev.sh --all stop
if: always()
smoke:
runs-on: ubuntu-26.04-arm
timeout-minutes: 90
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 26
package-manager-cache: false
- name: Install Dev Container CLI
# Standalone CLI, pinned independently of the application's client dependencies.
run: npm install --global @devcontainers/cli@0.89.0 # zizmor: ignore[adhoc-packages]
- name: Test host launchers
run: |
python3 -m unittest discover -s .devcontainer -p test_environment.py
python3 -m unittest discover -s .devcontainer -p test_rundev.py
- name: Test container bootstrap and isolation
env:
# The Dev Container CLI generates its Dockerfile outside the build context.
BUILDX_BAKE_ENTITLEMENTS_FS: '0'
run: python3 .devcontainer/smoke.py
podman:
name: Rootless Podman smoke test
runs-on: ubuntu-26.04
timeout-minutes: 45
env:
WEBLATE_CONTAINER_ENGINE: podman
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install apt dependencies
uses: $/.github/actions/apt-install
with:
profile: tools
- name: Prepare rootless Podman
run: |
# Allow Podman to stop pasta on Ubuntu 26.04 (actions/runner-images#15182).
pasta_profile=/etc/apparmor.d/usr.bin.pasta
if [[ -f "$pasta_profile" ]] && ! grep -Eq '^[[:space:]]*signal \(receive\) set=\(term\) peer=podman,[[:space:]]*(#.*)?$' "$pasta_profile"; then
sudo sed -i '$ i\ signal (receive) set=(term) peer=podman,' "$pasta_profile"
sudo apparmor_parser -r "$pasta_profile"
fi
systemctl --user start podman.socket
podman compose version | grep '^Docker Compose version '
- run: ./rundev.sh test weblate/checks/tests/test_chars_checks.py
- run: ./rundev.sh start
- name: Check loopback services and checkout ownership
run: |
urls=$(./rundev.sh urls --json)
app=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["application"])' <<< "$urls")
mailbox=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["mailbox"])' <<< "$urls")
curl --fail --silent --show-error "${app}healthz/" > /dev/null
curl --fail --silent --show-error "${mailbox}index.html" > /dev/null
curl --fail --silent --show-error "${mailbox}api/email" > /dev/null
probe=$(mktemp -d .podman-smoke.XXXXXX)
trap 'rm -r -- "$probe"' EXIT
./rundev.sh exec -- touch "$probe/app"
./scripts/devcontainer --backend compose exec -- touch "$probe/tests"
owner="$(id -u):$(id -g)"
test "$(stat -c '%u:%g' "$probe/app")" = "$owner"
test "$(stat -c '%u:%g' "$probe/tests")" = "$owner"
- run: ./rundev.sh --all logs
if: failure()
- run: ./rundev.sh --all destroy --yes
if: always()
oss-scanner:
name: OSS Scanner offline smoke test
runs-on: ubuntu-26.04
timeout-minutes: 65
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build the scanner target from the checkout
timeout-minutes: 45
run: docker build --progress=plain -f dev-docker/weblate-dev/Dockerfile -t weblate-oss-scanner .
- name: Verify the image without network or mounted files
timeout-minutes: 15
run: >-
docker run --name weblate-oss-scanner-smoke --init --network none
--cpus 2 --memory 8g --user 0 --workdir /src --entrypoint bash
weblate-oss-scanner .oss-scanner/smoke
- name: Print scanner smoke logs
if: failure()
run: docker logs weblate-oss-scanner-smoke
- name: Remove the smoke container and its anonymous volumes
if: always()
run: docker rm --force --volumes weblate-oss-scanner-smoke
verification:
name: Agent verification
runs-on: ubuntu-26.04
timeout-minutes: 90
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- run: ./scripts/devcontainer --backend compose up
- name: Test verification helpers
run: ./scripts/devcontainer --backend compose exec -- uv run --no-sync python -m unittest discover -s .devcontainer -p 'test_*.py'
- name: Run all verification groups
run: ./scripts/devcontainer --backend compose verify
- name: Verify frontend output isolation
if: always()
run: git diff --exit-code -- weblate/static/js/vendor weblate/static/styles/vendor client/yarn.lock
- name: Verify prepared OCR without networking
run: python3 .devcontainer/ocr_smoke.py
- run: ./scripts/devcontainer --backend compose logs
if: always()
- run: ./scripts/devcontainer --backend compose destroy --yes
if: always()
migration-verification:
name: Agent migration verification (${{ matrix.version }})
runs-on: ubuntu-26.04
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
version: ['5.10', '5.14']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Verify populated historical upgrade
env:
SOURCE_VERSION: ${{ matrix.version }}
run: ./scripts/devcontainer migration-test "$SOURCE_VERSION"
browser:
name: Browser tests (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04-arm
selection: ''
- runner: ubuntu-24.04
selection: test_login_form_accessibility or test_js_unit_tests
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Run Selenium in the development container
env:
SELECTION: ${{ matrix.selection }}
run: ./scripts/devcontainer --backend compose browser-test -k "$SELECTION"
- run: ./scripts/devcontainer --backend compose logs
if: always()
- run: ./scripts/devcontainer --backend compose stop
if: always()