From bd811b80380722ad6c8c79d61e3300fc434756dd Mon Sep 17 00:00:00 2001 From: ricolin Date: Wed, 13 Nov 2024 14:36:13 +0800 Subject: [PATCH] Move UT and linters jobs to Zuul --- .github/workflows/linters.yaml | 43 -------------------------------- .github/workflows/unittests.yaml | 29 --------------------- tox.ini | 14 ++++++----- zuul.d/jobs.yaml | 9 +++++++ zuul.d/project.yaml | 5 ++++ 5 files changed, 22 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/linters.yaml delete mode 100644 .github/workflows/unittests.yaml create mode 100644 zuul.d/jobs.yaml create mode 100644 zuul.d/project.yaml diff --git a/.github/workflows/linters.yaml b/.github/workflows/linters.yaml deleted file mode 100644 index 2018b3a..0000000 --- a/.github/workflows/linters.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: linters - -on: - workflow_dispatch: - push: - branches: - - 'main' - tags: - - 'v*' - pull_request: - branches: - - 'main' - -jobs: - super-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: github/super-linter@v4 - env: - DEFAULT_BRANCH: main - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_ALL_CODEBASE: true - VALIDATE_DOCKERFILE_HADOLINT: false - VALIDATE_PYTHON_ISORT: false - VALIDATE_PYTHON_BLACK: false - VALIDATE_PYTHON_MYPY: false - VALIDATE_JSCPD: false - pep8: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y tox - - - name: Run tox -e pep8 - run: tox -e pep8 diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml deleted file mode 100644 index 946d2fc..0000000 --- a/.github/workflows/unittests.yaml +++ /dev/null @@ -1,29 +0,0 @@ -name: unuttests - -on: - workflow_dispatch: - push: - branches: - - 'main' - tags: - - 'v*' - pull_request: - branches: - - 'main' - -jobs: - unuttest: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Python - uses: actions/setup-python@v4 - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y tox - - - name: Run tox -e py3 - run: tox -e py3 diff --git a/tox.ini b/tox.ini index bdbf5da..7bf9cf3 100755 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,pep8 +envlist = py3,linters skipsdist = True sitepackages = False skip_missing_interpreters = True @@ -21,15 +21,11 @@ install_commands = pip install {opts} {packages} -[testenv:py3] +[testenv:{py3,py38,py39,py310}] basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:pep8] -commands = - flake8 - [testenv:cover] basepython = python3 deps = -r{toxinidir}/requirements.txt @@ -45,6 +41,12 @@ commands = coverage xml -o cover/coverage.xml coverage report +[testenv:linters] +skipsdist = True +deps = + pre-commit +commands = + pre-commit run --all-files --show-diff-on-failure [testenv:venv] commands = {posargs} diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml new file mode 100644 index 0000000..d7e620d --- /dev/null +++ b/zuul.d/jobs.yaml @@ -0,0 +1,9 @@ +- job: + name: staffeln-linters + parent: tox-linters + +- job: + name: staffeln-unit + parent: tox + vars: + tox_envlist: py3 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml new file mode 100644 index 0000000..065d68e --- /dev/null +++ b/zuul.d/project.yaml @@ -0,0 +1,5 @@ +- project: + check: + jobs: + - staffeln-linters + - staffeln-unit