-
Notifications
You must be signed in to change notification settings - Fork 2
228 lines (188 loc) · 5.65 KB
/
lints_tests.yml
File metadata and controls
228 lines (188 loc) · 5.65 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
name: Lints and Tests
on:
pull_request:
branches:
- develop
push:
branches:
- develop
- main
jobs:
lint-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 11
- name: Setup npm
uses: actions/setup-node@v4
with:
node-version: 23
- name: Install dependencies
run: cd ui && make deps
- name: Lint
run: cd ui && make lint
lint-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: cd api && make deps
- name: Lint
run: cd api && make lint
check-migrations:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: my_solid_app_db_root_password
MYSQL_DATABASE: my_solid_app_db
MYSQL_USER: my_solid_app_user
MYSQL_PASSWORD: my_solid_app_password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: cd api && make deps
- name: Check for unmigrated changes
run: |
cd api
before=$(ls migrations/versions/*.py | wc -l)
make db_migrate
after=$(ls migrations/versions/*.py | wc -l)
if [ "$after" -gt "$before" ]; then
echo "::error::Database model changes detected without corresponding migration. Please use 'make db_migrate' to create the required migration."
exit 1
fi
check-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Check translations
run: cd ui && make check_translations
tests-api:
runs-on: ubuntu-latest
needs: [lint-ui, lint-api, check-translations, check-migrations]
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: cd api && make deps
- name: Tests
run: cd api && make test
tests-cypress-e2e:
runs-on: ubuntu-latest
needs: [lint-ui, lint-api, check-translations, check-migrations]
services:
db:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: my_solid_app_db_root_password
MYSQL_DATABASE: my_solid_app_db
MYSQL_USER: my_solid_app_user
MYSQL_PASSWORD: my_solid_app_password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:latest
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
mail:
image: maildev/maildev
env:
MAILDEV_INCOMING_USER: mysolidapp@mail.com
MAILDEV_INCOMING_PASS: 12345678
ports:
- 1080:1080
- 1025:1025
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 23
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 11
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install API dependencies
run: cd api && python -m venv .env && source .env/bin/activate && make deps
- name: Run API server on background
run: cd api && source .env/bin/activate && make MY_SOLID_APP_FILE_LOGGING=True server &
- name: Run tasks server on background
run: cd api && source .env/bin/activate && make worker &
- name: Run Cypress Tests
uses: cypress-io/github-action@v6
with:
install-command: make deps
working-directory: ui
start: pnpm run dev
wait-on: "http://localhost:5173"
wait-on-timeout: 10
browser: chrome
env:
CYPRESS_BASE_URL: http://localhost:5173
CYPRESS_MAIL_HOST: localhost
CYPRESS_MAIL_PORT: 1080
- name: Upload screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: ui/cypress/screenshots
- name: Upload API Logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: api-logs
path: api/api.log
docker-api-build-test:
runs-on: ubuntu-latest
needs: [tests-api, tests-cypress-e2e]
steps:
- name: Setup
uses: actions/checkout@v4
- name: Build docker image
run: cd api && make docker_build_api
docker-tasks-build-test:
runs-on: ubuntu-latest
needs: [tests-api, tests-cypress-e2e]
steps:
- name: Setup
uses: actions/checkout@v4
- name: Build docker image
run: cd api && make docker_build_tasks
docker-ui-build-test:
runs-on: ubuntu-latest
needs: [tests-api, tests-cypress-e2e]
steps:
- name: Setup
uses: actions/checkout@v4
- name: Build docker image
run: cd ui && make docker_build