Switch to using env var for pytest jobs, skip pylint

When I tried to include a default workers arg at the top level of the
matrix definition all it ended up doing it running a single job with "-n
2" and ignoring the whole include block, weird. Don't really understand
it yet: https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#expanding-or-adding-matrix-configurations

Falling back to putting it in an env var so at least it's only specified
once.

Drop the pylint parallelism because it's complaining that `Value
'config.cache' is unsubscriptable (unsubscriptable-object)` in many
places. Aha, that's why I've been seeing that locally and not on CI!
This commit is contained in:
toofar 2024-05-26 12:08:00 +12:00
parent da0e86aa1f
commit 82bb28adf6
1 changed files with 4 additions and 6 deletions

View File

@ -9,6 +9,7 @@ env:
FORCE_COLOR: "1"
PY_COLORS: "1"
MYPY_FORCE_TERMINAL_WIDTH: "180"
CI_PYTEST_WORKERS: "-n 2"
jobs:
linters:
@ -20,7 +21,6 @@ jobs:
matrix:
include:
- testenv: pylint
args: "-j 0"
- testenv: flake8
- testenv: mypy-pyqt6
- testenv: mypy-pyqt5
@ -91,7 +91,6 @@ jobs:
strategy:
fail-fast: false
matrix:
workers: ["-n 2"]
include:
- testenv: py-qt5
image: archlinux-webkit
@ -120,7 +119,7 @@ jobs:
- name: Set up problem matchers
run: "python scripts/dev/ci/problemmatchers.py tests ${{ runner.temp }}"
- name: Run tox
run: "dbus-run-session -- tox -e ${{ matrix.testenv }} -- ${{ matrix.workers }}"
run: "dbus-run-session -- tox -e ${{ matrix.testenv }} -- $CI_PYTEST_WORKERS"
tests:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
@ -129,7 +128,6 @@ jobs:
strategy:
fail-fast: false
matrix:
workers: ["-n 2"]
include:
### PyQt 5.15.2 (Python 3.8)
- testenv: py38-pyqt5152
@ -221,10 +219,10 @@ jobs:
run: "tox exec -e ${{ matrix.testenv }} -- python scripts/dev/update_3rdparty.py --gh-token ${{ secrets.GITHUB_TOKEN }}"
if: "startsWith(matrix.os, 'windows-')"
- name: "Run ${{ matrix.testenv }}"
run: "dbus-run-session -- tox -e ${{ matrix.testenv }} -- ${{ matrix.workers }} ${{ matrix.args }}"
run: "dbus-run-session -- tox -e ${{ matrix.testenv }} -- $CI_PYTEST_WORKERS ${{ matrix.args }}"
if: "startsWith(matrix.os, 'ubuntu-')"
- name: "Run ${{ matrix.testenv }} without DBus"
run: "tox -e ${{ matrix.testenv }} -- ${{ matrix.workers }} ${{ matrix.args }}"
run: "tox -e ${{ matrix.testenv }} -- $CI_PYTEST_WORKERS ${{ matrix.args }}"
if: "!startsWith(matrix.os, 'ubuntu-')"
- name: Analyze backtraces
run: "bash scripts/dev/ci/backtrace.sh ${{ matrix.testenv }}"