CI #572
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
services: | |
ldap: | |
image: osixia/openldap:latest | |
ports: | |
- 389:389 | |
env: | |
LDAP_DOMAIN: services.sram.tld | |
LDAP_ADMIN_USERNAME: admin | |
LDAP_ADMIN_PASSWORD: secret | |
LDAP_CONFIG_PASSWORD: config | |
LDAP_BASE_DN: dc=services,dc=sram,dc=tld | |
LDAP_TLS: true | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 | |
- 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 sramPerson; | |
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 |