From 8b4eb318bfd6a32103da7fb19096ae7f84509b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Sun, 22 Sep 2024 20:08:16 +0100 Subject: [PATCH] Use tox-uv for code quality CI (#1202) * Use tox-uv for code quality CI * Add jobs back --- .github/workflows/code_quality.yml | 34 ++++++++++++++++++------------ .github/workflows/tests.yml | 8 +++---- tox.ini | 2 +- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index eee95d11..9ab2b3c7 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -2,34 +2,42 @@ name: Code quality on: push: - branches: [main] + branches: + - main pull_request: - branches: [main] schedule: - cron: "0 4 * * *" -jobs: - mypy: - name: Type checks +jobs: + check: + name: tox env ${{ matrix.tox_env }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + tox_env: + - types steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v3 + with: + enable-cache: true + cache-dependency-glob: "pyproject.toml" + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Install tox - run: pip install tox + run: uv tool install tox --with tox-uv + + - name: Run check for tox env "${{ matrix.tox_env }}" + run: tox -e ${{ matrix.tox_env }} - - name: Run mypy - run: tox -e mypy flake8: name: Code style diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6eb12375..f2ccce7e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,10 +1,10 @@ -name: Checks +name: Tests on: push: - branches: [main] + branches: + - main pull_request: - branches: [main] schedule: - cron: "0 4 * * *" @@ -55,8 +55,6 @@ jobs: run: echo "C:/Users/runneradmin/.local/bin" >> $GITHUB_PATH shell: bash - - run: tox --help - - name: Setup test suite run: tox run -v --notest --skip-missing-interpreters false -e ${{ matrix.python }} diff --git a/tox.ini b/tox.ini index d3723b8e..59ba7a05 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ commands = --cov-report=xml \ {posargs} -[testenv:mypy] +[testenv:types] deps = mypy pip