Skip to content

Refactored tests and scripts for better modularity and reusability #4

Refactored tests and scripts for better modularity and reusability

Refactored tests and scripts for better modularity and reusability #4

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13" ]
env:
COVERAGE_PROCESS_START: ${{ github.workspace }}/.coveragerc
TESTCONTAINERS_RYUK_DISABLED: true
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Check Docker is available
run: docker ps
- name: Run tests with coverage
run: |
source .venv/bin/activate
pytest --cov=producer --cov=consumer --cov-report=xml
# Only upload coverage from the main Python version (3.12)
- name: Upload coverage to Codecov (only on Python 3.12)
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true