Skip to content

WIP

WIP #560

Workflow file for this run

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};
ldapwhoami -H ${LDAP_URL} -D cn=admin,cn=config -w ${LDAP_CONFIG_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