2022-11-24 14:34:30 +00:00
|
|
|
---
|
|
|
|
name: tests
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-11-24 14:36:57 +00:00
|
|
|
- main
|
|
|
|
- '*.*.*'
|
2022-11-24 14:34:30 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2022-11-24 14:36:57 +00:00
|
|
|
- main
|
|
|
|
- '*.*.*'
|
2022-11-24 14:34:30 +00:00
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: ${{ matrix.python }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
python:
|
2023-11-01 19:22:26 +00:00
|
|
|
- '3.12'
|
2022-11-24 14:34:30 +00:00
|
|
|
- '3.11'
|
|
|
|
- '3.10'
|
|
|
|
- '3.9'
|
|
|
|
steps:
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-13 11:14:19 +00:00
|
|
|
- name: Install Poetry
|
|
|
|
uses: snok/install-poetry@v1
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-11-24 14:34:30 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
2023-08-13 11:10:27 +00:00
|
|
|
cache: 'poetry'
|
2022-11-24 14:53:25 +00:00
|
|
|
- name: Install apt dependencies
|
2024-04-27 08:10:45 +00:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo DEBIAN_FRONTEND=noninteractive apt --yes --quiet install apparmor-utils libsasl2-dev python3-dev libldap2-dev libssl-dev slapd ldap-utils
|
2022-11-24 14:53:25 +00:00
|
|
|
- name: App armor configuration for slapd
|
2024-04-27 08:10:45 +00:00
|
|
|
if: ${{ !env.ACT }}
|
2022-11-24 14:53:25 +00:00
|
|
|
run: sudo aa-complain /usr/sbin/slapd
|
2024-05-08 07:37:25 +00:00
|
|
|
- name: Install dependencies and run tests
|
|
|
|
run: |
|
2024-04-27 08:10:45 +00:00
|
|
|
# python tzinfo fails on 'act' without this
|
|
|
|
ulimit -n 1024
|
|
|
|
export TZ=UTC
|
|
|
|
poetry --version
|
|
|
|
poetry install --extras all
|
2024-04-27 12:06:15 +00:00
|
|
|
poetry run pytest --showlocals
|
2023-08-13 11:10:27 +00:00
|
|
|
minversions:
|
|
|
|
name: minimum dependency versions
|
2022-11-24 14:34:30 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-13 11:14:19 +00:00
|
|
|
- name: Install Poetry
|
|
|
|
uses: snok/install-poetry@v1
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-11-24 14:34:30 +00:00
|
|
|
with:
|
2024-04-21 09:25:06 +00:00
|
|
|
python-version: '3.9'
|
2023-08-13 11:10:27 +00:00
|
|
|
cache: 'poetry'
|
2022-11-24 15:09:47 +00:00
|
|
|
- name: Install apt dependencies
|
2024-04-27 08:10:45 +00:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo DEBIAN_FRONTEND=noninteractive apt --yes --quiet install apparmor-utils libsasl2-dev python3-dev libldap2-dev libssl-dev slapd ldap-utils
|
2022-11-24 15:09:47 +00:00
|
|
|
- name: App armor configuration for slapd
|
2024-04-27 08:10:45 +00:00
|
|
|
if: ${{ !env.ACT }}
|
2022-11-24 15:09:47 +00:00
|
|
|
run: sudo aa-complain /usr/sbin/slapd
|
2024-05-08 07:41:53 +00:00
|
|
|
- run: sed -i -E 's/"(\^|>=)([0-9\.]+)([^,]*)"/"==\2"/' pyproject.toml
|
2023-08-13 12:17:46 +00:00
|
|
|
- run: sed -i -E 's/python = "==/python = "^/' pyproject.toml
|
2024-05-08 07:37:25 +00:00
|
|
|
- name: Install dependencies and run tests
|
|
|
|
run: |
|
2024-04-27 08:10:45 +00:00
|
|
|
# python tzinfo fails on 'act' without this
|
|
|
|
ulimit -n 1024
|
|
|
|
export TZ=UTC
|
|
|
|
poetry --version
|
|
|
|
poetry lock
|
|
|
|
poetry install --extras all
|
2024-04-27 12:06:15 +00:00
|
|
|
poetry run pytest --showlocals
|
2023-08-13 11:10:27 +00:00
|
|
|
style:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/checkout@v4
|
2024-04-14 17:49:46 +00:00
|
|
|
- uses: pre-commit/action@v3.0.1
|
2022-11-24 14:34:30 +00:00
|
|
|
doc:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-13 11:14:19 +00:00
|
|
|
- name: Install Poetry
|
|
|
|
uses: snok/install-poetry@v1
|
2024-04-14 17:44:01 +00:00
|
|
|
- uses: actions/setup-python@v5
|
2022-11-24 14:34:30 +00:00
|
|
|
with:
|
2023-11-01 19:22:26 +00:00
|
|
|
python-version: '3.12'
|
2023-08-13 11:10:27 +00:00
|
|
|
cache: 'poetry'
|
2022-11-24 15:09:47 +00:00
|
|
|
- name: Install apt dependencies
|
2024-04-27 08:10:45 +00:00
|
|
|
run: |
|
|
|
|
sudo apt update
|
|
|
|
sudo DEBIAN_FRONTEND=noninteractive apt --yes --quiet install libsasl2-dev python3-dev libldap2-dev libssl-dev slapd ldap-utils
|
|
|
|
- run: |
|
|
|
|
export TZ=UTC
|
|
|
|
poetry install --with doc
|
|
|
|
poetry run sphinx-build doc build/sphinx/html
|