Skip to content

Commit

Permalink
chore: Use tox-gh-actions in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
paveldedik committed Mar 13, 2024
1 parent 311aa87 commit fe2dd13
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
42 changes: 20 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,26 @@ on: [pull_request]

jobs:
integration-and-unit:
name: Run integration and unit tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-22.04, windows-2019]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false

name: Env (Python ${{ matrix.python }} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@master
- name: Setting up tox environment
uses: docker://kiwicom/tox:3.25.0
env:
TOXENV: ${{ matrix.toxenv }}
XDG_CACHE_HOME: /tmp/cache
- uses: actions/[email protected]
with:
args: >
sh -c
"
mkdir -p reports ;
apk add --no-cache cargo ;
tox -e $TOXENV -- --junitxml=reports/$TOXENV/test_report.xml --cov-report xml --cov-config .coveragerc --cov-append --cov-report xml:reports/coverage.xml
"
- name: Cache multiple paths
uses: actions/cache@v2
fetch-depth: 1

- uses: actions/setup-python@v5
with:
path: .tox
key: ${{ runner.os }}-${{ hashFiles('poetry.lock') }}
strategy:
matrix:
toxenv: [py37, py38, py39, py310, py311, py312]
python-version: ${{ matrix.python }}

- name: Install tox
run: pip install tox tox-gh-actions

- name: Run tox
run: python -m tox
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ classifiers=[
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
include = ["*.md", "*.toml", "*.txt", "*.yml", "*.yaml", ".coveragerc", "tox.ini", "structlog_sentry/py.typed"]
Expand Down
9 changes: 9 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ envlist =
py{37,38,39,310,311,312}
isolated_build = true

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
whitelist_externals = poetry
deps = poetry
Expand Down

0 comments on commit fe2dd13

Please sign in to comment.