-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (51 loc) · 1.5 KB
/
ci.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
name: CI
on:
push:
pull_request:
env:
LDAP_BIND_SERVER: "ldap://dirsrv:3389"
LDAP_BIND_DN: "cn=Directory Manager"
LDAP_BIND_PASSWORD: "asd"
TEST_SUFFIX: "dc=example,dc=test"
jobs:
run-tests:
strategy:
matrix:
python: [ '3.9', '3.12', 'latest' ]
services:
dirsrv:
image: "389ds/dirsrv:3.0"
ports:
- 3389:3389
env:
DS_SUFFIX_NAME: ${{env.TEST_SUFFIX}}
DS_DM_PASSWORD: ${{env.LDAP_BIND_PASSWORD}}
options: >-
--health-cmd "dsctl localhost healthcheck --check backends:localhost:search" --health-interval 10s --health-timeout 5s --health-retries 5
runs-on: ubuntu-latest
container:
image: ${{ matrix.python }}
env:
LDAP_BIND_SERVER: ${{env.LDAP_BIND_SERVER}}
LDAP_BIND_DN: ${{env.LDAP_BIND_DN}}
LDAP_BIND_PASSWORD: ${{env.LDAP_BIND_PASSWORD}}
TEST_SUFFIX: ${{env.TEST_SUFFIX}}
steps:
- name: Checkout
uses: actions/checkout@v3
# - name: Setup Python
# uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.python }}
- name: Install package dependencies
run: |
sudo apt-get install -y libsasl2-dev python-dev-is-python3 libldap2-dev libssl-dev
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- name: Install pytest
run: |
pip install pytest
- name: Run test script
run: |
pytest tests/tests.py