diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8ee3948..c63390a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,8 @@ on: branches: [master] jobs: - build: + test: + name: Test with tox runs-on: ubuntu-latest strategy: matrix: @@ -18,17 +19,27 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 - with: - fetch-depth: 2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | - pip install uv tox tox-gh-actions tox-uv + pip install uv tox tox-uv + + - name: Cache tox environments + uses: actions/cache@v4 + with: + path: .tox + key: tox-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('tox.ini', 'requirements.txt', 'requirements-test.txt') }} + restore-keys: | + tox-${{ runner.os }}-${{ matrix.python-version }}- + tox-${{ runner.os }}- + - name: Test with tox - run: tox + run: | + tox -p auto diff --git a/tox.ini b/tox.ini index 4cf902f..3f989c1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = py312, py313, lint, typing, coverage skip_missing_interpreters = True +parallel = True [gh-actions] python = @@ -17,25 +18,23 @@ deps = [testenv:lint] basepython = python3 ignore_errors = True +skip_install = True +usedevelop = False commands = ruff check . ruff format --check . -deps = - -rrequirements.txt - -rrequirements-test.txt [testenv:typing] basepython = python3 ignore_errors = True +skip_install = True +usedevelop = False commands = mypy gios -deps = - -rrequirements.txt - -rrequirements-test.txt [testenv:coverage] -deps = - -rrequirements.txt - -rrequirements-test.txt +depends = py312 +skip_install = True +usedevelop = False commands = coverage report --fail-under=79