commit: 8003c8acb8e0a73387535c338ee2d112781fe9fd Author: Oskari Pirhonen <xxc3ncoredxx <AT> gmail <DOT> com> AuthorDate: Wed Mar 22 05:50:39 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Mar 23 06:59:11 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=8003c8ac
actions: move pylint job into lint.yml Enable running the pylint job outside of just pushes or PR's to master. Don't run pylint as part of the CI/build job. Signed-off-by: Oskari Pirhonen <xxc3ncoredxx <AT> gmail.com> Closes: https://github.com/gentoo/portage/pull/1014 Signed-off-by: Sam James <sam <AT> gentoo.org> .github/workflows/ci.yml | 63 +++++++++++++++++++++++----------------------- .github/workflows/lint.yml | 35 ++++++++++++++++++++++++-- tox.ini | 24 +++++++++++------- 3 files changed, 79 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 12d01dd1d..29a5a60c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,41 +8,40 @@ on: jobs: build: - runs-on: ubuntu-22.04 strategy: matrix: python-version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - - '3.11' - - '3.12-dev' - - 'pypy-3.7' - - 'pypy-3.8' - - 'pypy-3.9' + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12-dev' + - 'pypy-3.7' + - 'pypy-3.8' + - 'pypy-3.9' fail-fast: false - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install python dependencies - run: | - set -xe - sudo apt-get update - sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libxml2-utils zstd - python -VV - python -m site - python -m pip install --upgrade pip - python -m pip install tox tox-gh-actions - - name: Test ./setup.py install --root=/tmp/install-root - run: | - printf "[build_ext]\nportage_ext_modules=true" >> setup.cfg - ./setup.py install --root=/tmp/install-root - - name: Run tox targets for ${{ matrix.python-version }} - run: | - tox -vv + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install python dependencies + run: | + set -xe + sudo apt-get update + sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libxml2-utils zstd + python -VV + python -m site + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + - name: Test ./setup.py install --root=/tmp/install-root + run: | + printf "[build_ext]\nportage_ext_modules=true" >> setup.cfg + ./setup.py install --root=/tmp/install-root + - name: Run tox test env for ${{ matrix.python-version }} + run: tox -vv + env: + TARGET: test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 977f62d89..8263567a1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,9 +1,9 @@ name: Lint -on: [push, pull_request] +on: [ push, pull_request ] jobs: - lint: + black: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -16,3 +16,34 @@ jobs: - uses: psf/black@stable with: src: . ${{ steps.stragglers.outputs.missed }} + + pylint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + # Complains about importing distutils.dir_utils + # - '3.12-dev' + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install python dependencies + run: | + set -xe + python -VV + python -m site + python -m pip install --upgrade pip + python -m pip install tox tox-gh-actions + - name: Run tox pylint env for ${{ matrix.python-version }} + run: tox -vv + env: + TARGET: pylint diff --git a/tox.ini b/tox.ini index 6760bde03..d8b84c80a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,24 +1,30 @@ [tox] -envlist = py{37,38,39,310}-pylint,py311,pypy3 +envlist = py{37,38,39,310,311,312}-{pylint,test},pypy3-test skipsdist = True [gh-actions] python = - 3.7: py37-pylint - 3.8: py38-pylint - 3.9: py39-pylint - 3.10: py310-pylint - 3.11: py311 - pypy-3: pypy3 + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 + pypy-3: pypy3 + +[gh-actions:env] +TARGET = + pylint: pylint + test: test [testenv] deps = pylint: pylint - pyyaml + test: pyyaml setenv = PYTHONPATH={toxinidir}/lib allowlist_externals = ./run-pylint commands = pylint: ./run-pylint - python -b -Wd setup.py test + test: python -b -Wd setup.py test
