-
-
Notifications
You must be signed in to change notification settings - Fork 20
72 lines (59 loc) · 1.94 KB
/
run-unit-tests.yml
File metadata and controls
72 lines (59 loc) · 1.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
name: Run unit tests
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
env:
DATABASE_NAME: dejacode
DATABASE_USER: dejacode
DATABASE_PASSWORD: dejacode
POSTGRES_INITDB_ARGS: --encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
jobs:
run-unit-tests:
runs-on: ubuntu-24.04
permissions:
contents: read
services:
postgres:
image: postgres:16.13
env:
POSTGRES_DB: ${{ env.DATABASE_NAME }}
POSTGRES_USER: ${{ env.DATABASE_USER }}
POSTGRES_PASSWORD: ${{ env.DATABASE_PASSWORD }}
POSTGRES_INITDB_ARGS: ${{ env.POSTGRES_INITDB_ARGS }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false # do not keep the token around
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
- name: Install python-ldap OS dependencies
run: |
sudo apt-get update
sudo apt-get install -y libldap2-dev libsasl2-dev slapd ldap-utils
- name: Disable AppArmor for slapd
run: |
sudo ln -s /etc/apparmor.d/usr.sbin.slapd /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.slapd
- name: Install dependencies
run: make dev envfile
- name: Validate code format
run: make check
- name: Start Redis
uses: supercharge/redis-github-action@bc274cb7238cd63a45029db04ee48c07a72609fd # v1.8.1
- name: Build the documentation
run: make docs
- name: Run tests
run: .venv/bin/python manage.py test --verbosity=2 --noinput --parallel