Skip to content

Commit

Permalink
Use tox-uv for code quality CI (#1202)
Browse files Browse the repository at this point in the history
* Use tox-uv for code quality CI

* Add jobs back
  • Loading branch information
fepegar authored Sep 22, 2024
1 parent 7bb2b4c commit 8b4eb31
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Checks
name: Tests

on:
push:
branches: [main]
branches:
- main
pull_request:
branches: [main]
schedule:
- cron: "0 4 * * *"

Expand Down Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ commands =
--cov-report=xml \
{posargs}

[testenv:mypy]
[testenv:types]
deps =
mypy
pip
Expand Down

0 comments on commit 8b4eb31

Please sign in to comment.