Repository navigation
157 lines (136 loc) · 4.94 KB
/
Copy pathci.yml
File metadata and controls
157 lines (136 loc) · 4.94 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
name: Suite Cloud CI
on:
push:
branches:
- develop
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
# One runner per deployment type. Core covers what every hosted product shares (sites,
# zones, settings); each product's tests live in its own module folder and get a runner
# of their own, so a Cloud Meet leg is one more row here.
strategy:
fail-fast: false
matrix:
include:
- name: Core
tests: suite_cloud/tests
- name: Mail
tests: suite_cloud/mail/tests
- name: Hosting
tests: suite_cloud/hosting/tests
- name: Telemetry
tests: suite_cloud/telemetry/tests
services:
redis-cache:
image: redis:alpine
ports:
- 13000:6379
redis-queue:
image: redis:alpine
ports:
- 11000:6379
mariadb:
image: mariadb:10.6
env:
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone
uses: actions/checkout@v4
# What an Ubuntu 20.04 node has, for the test that the pinned Ansible still manages it. Set up
# before the bench's own Python so that `python` stays 3.14.
- name: Setup Python 3.8 (Ansible target)
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
check-latest: true
- name: Cache pip
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.cache/uv
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install MariaDB Client
run: |
sudo apt update
sudo apt-get install -y mariadb-client
# The delivery tests send mail through the release new clusters install. It is read from the
# setting's default, so that moving the pin moves this with it.
- name: Install Stalwart (delivery tests)
if: matrix.name == 'Mail'
run: |
settings=suite_cloud/suite_cloud/doctype/suite_cloud_settings/suite_cloud_settings.json
version="$(jq -r '.fields[] | select(.fieldname == "stalwart_version") | .default' "$settings")"
archive="https://github.com/stalwartlabs/stalwart/releases/download/${version}/stalwart-x86_64-unknown-linux-gnu.tar.gz"
curl -fsSL "$archive" | sudo tar -xz -C /usr/local/bin stalwart
sudo chmod +x /usr/local/bin/stalwart # the archive holds it without the execute bit
stalwart --version
- name: Setup Bench
run: |
pip install frappe-bench
bench init --skip-redis-config-generation --skip-assets --python "$(which python)" ~/frappe-bench
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL character_set_server = 'utf8mb4'"
mariadb --host 127.0.0.1 --port 3306 -u root -proot -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'"
- name: Install Suite Cloud
working-directory: /home/runner/frappe-bench
run: |
bench get-app insights --branch develop --skip-assets # required by suite_cloud
bench get-app suite_cloud "$GITHUB_WORKSPACE" --skip-assets
bench setup requirements --dev
bench new-site --db-root-password root --admin-password admin test_site
bench --site test_site install-app suite_cloud
env:
CI: "Yes"
- name: Run ${{ matrix.name }} Tests
working-directory: /home/runner/frappe-bench
run: |
bench --site test_site set-config allow_tests true
status=0
for file in "$GITHUB_WORKSPACE"/${{ matrix.tests }}/test_*.py; do
rel="${file#"$GITHUB_WORKSPACE"/}"
module="$(echo "${rel%.py}" | tr / .)"
echo "::group::$module"
bench --site test_site run-tests --app suite_cloud --module "$module" || status=1
echo "::endgroup::"
done
exit "$status"
env:
TYPE: server
lint:
name: Ruff
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install Ruff
run: pip install ruff==0.14.10
- name: Check
run: |
ruff check .
ruff format --check .