Skip to content

Commit

Permalink
Improve CI (#485)
Browse files Browse the repository at this point in the history
* Improve CI

* Update test.yml
  • Loading branch information
bieniu authored Feb 6, 2025
1 parent 2a50a3e commit 4bacf76
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ on:
branches: [master]

jobs:
build:
test:
name: Test with tox
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -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
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist = py312, py313, lint, typing, coverage
skip_missing_interpreters = True
parallel = True

[gh-actions]
python =
Expand All @@ -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

0 comments on commit 4bacf76

Please sign in to comment.