tests.yml: Fix GitHub action to get Qt tests to work.

Also add Python 3.12 testing.

Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This commit is contained in:
Chris PeBenito 2023-10-17 12:10:17 -04:00 committed by Chris PeBenito
parent c3d4c72d17
commit 89d7145cae
2 changed files with 16 additions and 7 deletions

View File

@ -27,8 +27,9 @@ jobs:
matrix:
build-opts:
- {python: '3.10', tox: python3.10}
- {python: '3.11', tox: python3.11}
- {python: '3.10', tox: python3}
- {python: '3.11', tox: python3}
- {python: '3.12', tox: python3}
- {python: '3.11', tox: pep8}
- {python: '3.11', tox: lint}
- {python: '3.11', tox: mypy}
@ -57,9 +58,14 @@ jobs:
xvfb \
x11-xserver-utils
sudo python -m pip install -U \
python -m pip install -U --user \
tox
# This is a curated list of packages to get Qt to work with xvfb in
# GitHub actions. https://github.com/tlambert03/setup-qt-libs
- name: Install Qt dependencies
uses: tlambert03/setup-qt-libs@v1
- name: Cache SELinux userspace
uses: actions/cache@v3
id: cache-userspace
@ -79,6 +85,9 @@ jobs:
make CFLAGS="-O2 -pipe -fPIC -Wall -I${{env.SEPOL_SRC}}/include" -C ${{env.CHECKPOLICY_SRC}}
- name: Run test
run: tox -e ${{ matrix.build-opts.tox }}
run: |
# confirm python version
python --version
python -m tox -e ${{ matrix.build-opts.tox }}
env:
LD_LIBRARY_PATH: "${{env.SEPOL_SRC}}/src:${{env.SELINUX_SRC}}/src:${LD_LIBRARY_PATH}"

View File

@ -15,12 +15,12 @@ commands = pycodestyle setools/ setoolsgui/ tests/ tests-gui/ seinfo sein
setenv = SETOOLS_COVERAGE = 1
passenv = {[testenv]passenv}
deps = {[testenv]deps}
coverage>=5.0
coverage>=6.0
extras = toml
commands_pre = coverage --version
coverage erase
{[testenv]commands_pre}
commands = coverage run -m pytest tests tests-gui
commands = coverage run --source=setools,setoolsgui -m pytest tests tests-gui
coverage report
[testenv:lint]
@ -34,7 +34,7 @@ commands = pylint -E setools setoolsgui tests tests-gui seinfo seinfoflow
[testenv:mypy]
deps = {[testenv]deps}
types-setuptools
mypy
mypy>=1.6.0
commands_pre = mypy --version
commands = mypy -p setools -p setoolsgui -p tests -p tests-gui
mypy --scripts-are-modules seinfo seinfoflow sedta sesearch sediff sechecker apol