-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (80 loc) · 2.55 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
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
name: CI
on:
push:
schedule:
- cron: "0 5 * * mon"
permissions: { }
jobs:
plsc-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start LDAP container
run: ./run-ldapci.sh
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libsasl2-dev libldap2-dev ldap-utils
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip flake8 gera2ld-pyserve
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check syntax
run: |
flake8 .
- name: ldap - Initialization...
run: >
sleep 5;
ldapwhoami -H ${LDAP_URL} -D ${LDAP_BIND_DN} -w ${LDAP_ADMIN_PASSWORD};
for f in access eduPerson voPerson groupOfMembers config;
do
ldapadd -H ${LDAP_URL}
-D cn=admin,cn=config
-w ${LDAP_CONFIG_PASSWORD}
-f etc/ldif/$f.ldif;
done;
env:
LDAP_URL: ldap://localhost:389
LDAP_ADMIN_PASSWORD: secret
LDAP_CONFIG_PASSWORD: config
LDAP_BASE_DN: dc=services,dc=sram,dc=tld
LDAP_BIND_DN: cn=admin,dc=services,dc=sram,dc=tld
# Setup tmate session
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Run pytest...
run: |
export PYTHONPATH="."
pytest
env:
LDAP_URL: ldap://localhost:389
LDAP_ADMIN_PASSWORD: secret
LDAP_BASE_DN: dc=services,dc=sram,dc=tld
LDAP_BIND_DN: cn=admin,dc=services,dc=sram,dc=tld
- name: Dump ldap...
run:
ldapsearch -x -H ${LDAP_URL} -b ${LDAP_BASE_DN} -s sub objectclass=organizationalUnit
env:
LDAP_URL: ldap://localhost:389
LDAP_BASE_DN: dc=services,dc=sram,dc=tld
# Setup tmate session
- name: Setup tmate session
env:
ACTIONS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG}}
if: ${{ failure() && env.ACTIONS_STEP_DEBUG == 'true' }}
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
timeout-minutes: 60