summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorsebres <serg.brester@sebres.de>2021-11-03 19:15:59 +0100
committersebres <serg.brester@sebres.de>2021-12-02 18:33:05 +0100
commit1bcb62e31ca0372abc4fefb81724f30fb6ff8837 (patch)
tree9bf8f8162cb591e89fe3a7a1819e212c29711278 /.github
parenta57643404c98fee74398cb175e7de1d3883a6f99 (diff)
downloadfail2ban-1bcb62e31ca0372abc4fefb81724f30fb6ff8837.tar.gz
gh-actions: python releases upgrade + debug/test systemd backend availability in GHA
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/main.yml31
1 files changed, 21 insertions, 10 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index e346635d..c0dc726b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
- python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10.0-rc.2', pypy2, pypy3]
+ python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11.0-alpha.1', pypy2, pypy3]
fail-fast: false
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
@@ -40,33 +40,44 @@ jobs:
- name: Python version
run: |
F2B_PY=$(python -c "import sys; print(sys.version)")
- echo "Python: ${{ matrix.python-version }} -- $F2B_PY"
+ echo "Python: ${{ matrix.python-version }} -- ${F2B_PY/$'\n'/ }"
F2B_PY=${F2B_PY:0:1}
echo "Set F2B_PY=$F2B_PY"
echo "F2B_PY=$F2B_PY" >> $GITHUB_ENV
- name: Install dependencies
run: |
- #python -m pip install --upgrade pip
+ if [[ "$F2B_PY" = 3 ]]; then python -m pip install --upgrade pip || echo "can't upgrade pip"; fi
if [[ "$F2B_PY" = 3 ]] && ! command -v 2to3x -v 2to3 > /dev/null; then
#pip install 2to3
sudo apt-get -y install 2to3
fi
- #pip install systemd-python || echo 'systemd not available'
- #pip install pyinotify || echo 'inotify not available'
- sudo apt-get -y install python${F2B_PY/2/}-systemd || echo 'systemd not available'
- sudo apt-get -y install python${F2B_PY/2/}-pyinotify || echo 'inotify not available'
+ #sudo apt-get -y install python${F2B_PY/2/}-pyinotify || echo 'inotify not available'
+ python -m pip install pyinotify || echo 'inotify not available'
+ #sudo apt-get -y install python${F2B_PY/2/}-systemd || echo 'systemd not available'
+ sudo apt-get -y install libsystemd-dev || echo 'systemd dependencies seems to be unavailable'
+ python -m pip install systemd-python || echo 'systemd not available'
- name: Before scripts
run: |
cd "$GITHUB_WORKSPACE"
# Manually execute 2to3 for now
if [[ "$F2B_PY" = 3 ]]; then echo "2to3 ..." && ./fail2ban-2to3; fi
+ _debug() { echo -n "$1 "; err=$("${@:2}" 2>&1) && echo 'OK' || echo -e "FAIL\n$err"; }
# (debug) output current preferred encoding:
- python -c 'import locale, sys; from fail2ban.helpers import PREFER_ENC; print(PREFER_ENC, locale.getpreferredencoding(), (sys.stdout and sys.stdout.encoding))'
+ _debug 'Encodings:' python -c 'import locale, sys; from fail2ban.helpers import PREFER_ENC; print(PREFER_ENC, locale.getpreferredencoding(), (sys.stdout and sys.stdout.encoding))'
+ # (debug) backend availabilities:
+ echo 'Backends:'
+ _debug '- systemd:' python -c 'from fail2ban.server.filtersystemd import FilterSystemd'
+ #_debug '- systemd (root): ' sudo python -c 'from fail2ban.server.filtersystemd import FilterSystemd'
+ _debug '- pyinotify:' python -c 'from fail2ban.server.filterpyinotify import FilterPyinotify'
- - name: Test suite
- run: if [[ "$F2B_PY" = 2 ]]; then python setup.py test; else python bin/fail2ban-testcases --verbosity=2; fi
+ # - name: Test suite
+ # run: if [[ "$F2B_PY" = 2 ]]; then python setup.py test; else python bin/fail2ban-testcases --verbosity=2; fi
+
+ - name: Test suite (debug some systemd tests only)
+ # run: python bin/fail2ban-testcases --verbosity=2 "[sS]ystemd|[jJ]ournal"
+ run: python bin/fail2ban-testcases --verbosity=2 -l 5 "test_WrongChar"
- name: Build
run: python setup.py build