-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.77 KB
/
tests.yml
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
---
name: Tests and Linters
"on":
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Set Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Setup Locales
run: |
sudo apt-get install -y locales gettext
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "fr_FR.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "ja_JP.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
sudo locale-gen
sudo locale -a
localectl status
- name: Add gettext for compilemessages
run: sudo apt-get install -y gettext
- name: Install Python Dependencies
run: |
python3.12 -m pip install --upgrade pip
python3.12 -m pip install hatch hatchling pre-commit
- name: Install Frontend Dependencies
run: yarn install
- name: Setup Env Variables
run: |
sed s/SECRET_KEY=/SECRET_KEY=fake-key/ example.env > .env
sed s/insecure-change-this/postgres/ -i .env
- name: Run pre-commit
run: pre-commit run --all-files
- name: Run Tests
run: |
hatch run ./manage.py compilemessages
hatch run test:cov
- name: Run Frontend Tests
run: yarn test