From 9362672e3501f125b958c7a1e54562a31eed0e9d Mon Sep 17 00:00:00 2001 From: Alexandre Muller Date: Thu, 18 Jan 2024 13:40:44 +0100 Subject: [PATCH] github: add tests workflow --- .github/workflows/quality.yml | 22 ++++++++++++++++ .github/workflows/tests.yml | 49 +++++++++++++++++++++++++++++++++++ Makefile | 8 +----- tox.ini | 4 +-- 4 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/quality.yml create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 00000000..ac4e30bf --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,22 @@ +name: Quality + +on: push + +jobs: + build: + name: quality + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.12 + - name: Install dependencies + run: | + sudo apt install libsasl2-dev libldap2-dev libssl-dev + python -m pip install --upgrade pip setuptools wheel + make upgrade + - name: Run checks + run: make lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..71c8664a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,49 @@ +name: Tests + +on: push + +jobs: + build: + runs-on: ubuntu-latest + + name: Python ${{ matrix.python-version }} / ${{ matrix.django }} + strategy: + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + django: + - django32 + - django42 + - django50 + exclude: + - django: django50 + python-version: "3.8" + - django: django50 + python-version: "3.9" + - django: django32 + python-version: "3.11" + - django: django32 + python-version: "3.12" + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install slapd + run: sudo apt install slapd ldap-utils apparmor-utils + - name: App armor configuration for slapd + run: sudo aa-complain /usr/sbin/slapd + - name: Install dependencies + run: | + sudo apt install libsasl2-dev libldap2-dev libssl-dev + python -m pip install --upgrade pip setuptools wheel + python -m pip install --upgrade tox + make upgrade + - name: Run tests + run: | + tox -v -e py-${{ matrix.django }} diff --git a/Makefile b/Makefile index 4e6bae67..9188ed5c 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,7 @@ PACKAGE := ldapdb TESTS_DIR := examples # Error on all warnings, except in python's site.py module and distutils' imp.py module. -PYWARNINGS = -Wdefault -Werror \ - -Wignore::DeprecationWarning:site:165 \ - -Wignore::PendingDeprecationWarning:imp \ - -Wignore::DeprecationWarning:imp \ - -Wignore::PendingDeprecationWarning:distutils \ - -Wignore::DeprecationWarning:distutils \ - -Wignore::ImportWarning: +PYWARNINGS = -Wdefault::DeprecationWarning default: diff --git a/tox.ini b/tox.ini index 4ecf5c90..361f8d98 100644 --- a/tox.ini +++ b/tox.ini @@ -12,10 +12,10 @@ deps = django42: Django>=4.2,<5.0 django50: Django>=5.0,<5.1 -whitelist_externals = make +allowlist_externals = make commands = make test [testenv:lint] extras = dev -whitelist_externals = make +allowlist_externals = make commands = make lint