Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,62 @@
name: run-tests

on:
pull_request:
push:
branches:
- main

permissions:
contents: read
actions: write

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v6

- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}

- name: Poetry Setup
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v6
with:
path: .venv
key: pydeps-${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Dependencies
run: poetry install
- name: Generate Report
if: steps.cache-deps.outputs.cache-hit != 'true'
run: poetry install --no-interaction --all-groups

- name: Run tests
run: |
poetry run coverage run -m unittest discover -s tests
poetry run coverage xml
poetry run pytest
poetry check
poetry run pip check

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v7
# Different Python versions are covered differently,
# so we only upload coverage for the latest version.
if: matrix.python-version == '3.14'
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ No arquivo `Makefile` do seu projeto, verifique se a seção de testes está con
```makefile
test:
ifeq ($(OS),Windows_NT)
@set PYTHONDONTWRITEBYTECODE=1 && poetry run python -m unittest discover tests/ -v
@set PYTHONDONTWRITEBYTECODE=1 && poetry run python pytest
else
@PYTHONDONTWRITEBYTECODE=1 poetry run python3 -m unittest discover tests/ -v
@PYTHONDONTWRITEBYTECODE=1 poetry run pytest
endif
```

Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ check:

test:
ifeq ($(OS),Windows_NT)
@set PYTHONDONTWRITEBYTECODE=1 && poetry run python -m unittest discover tests/ -v
@set PYTHONDONTWRITEBYTECODE=1 && poetry run pytest
else
@PYTHONDONTWRITEBYTECODE=1 poetry run python3 -m unittest discover tests/ -v
endif
@PYTHONDONTWRITEBYTECODE=1 poetry run pytest
endif

export-requirements-dev:
@poetry self add poetry-plugin-export
@poetry export -f requirements.txt --output requirements-dev.txt --all-groups
Loading
Loading