Skip to content

Commit

Permalink
Implement Github test action.
Browse files Browse the repository at this point in the history
  • Loading branch information
garyvdm committed May 15, 2024
1 parent 833cc03 commit 2cbb18e
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 9 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests
on:
push:
pull_request:

# concurrency:
# group: check-${{ github.ref }}
# cancel-in-progress: true

jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
pypy3.9
pypy3.10
- name: Install gi
run: |
sudo dd of=/etc/dpkg/dpkg.cfg.d/docker-apt-speedup <<< force-unsafe-io
sudo apt install libgirepository1.0-dev gir1.2-glib-2.0
- id: cache-pip
uses: actions/cache@v4
if: always()
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}
save-always: true

- name: Install tox
run: python3.12 -m pip install tox
- uses: actions/checkout@v4

- name: Run test suite
continue-on-error: true
run: tox

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
test-results/**/*.xml
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ dmypy.json

# vscode
.vscode/

test-results
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

29 changes: 29 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tox]
min_version = 4.0
env_list =
check
py38
py39
py310
py311
py312
; py313
; pypy39
; pypy310

[testenv]
deps =
pytest
pytest-asyncio
pytest-timeout
pytest-cov
pygobject
allowlist_externals = dbus-run-session
commands = dbus-run-session python -m pytest --junitxml=test-results/junit-{envname}.xml

[testenv:check]
deps = ruff
skip_install = true
commands =
ruff check --output-format=github
ruff format --check

0 comments on commit 2cbb18e

Please sign in to comment.