Skip to content

Refactor test_generate_gradcam_overlay() #204

Refactor test_generate_gradcam_overlay()

Refactor test_generate_gradcam_overlay() #204

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
build-test:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
python-version: ['3.11'] # Use a single version for deterministic Docker builds
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch==2.4.1+cpu torchvision==0.19.1+cpu --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
pip install pytest pytest-cov flake8
- name: Lint with Flake8
run: |
flake8 src app tests --max-line-length=100
- name: Run tests with coverage (host environment)
run: |
pytest -q --disable-warnings --maxfail=1 \
--cov=src --cov-report=term-missing --cov-fail-under=70
- name: Build Docker image
run: |
docker build -t pneumodetect:ci .
- name: Run tests inside Docker
run: |
docker run --rm pneumodetect:ci pytest -q --disable-warnings --maxfail=1 \
--cov=src --cov-report=term-missing --cov-fail-under=70