Skip to content
Merged
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
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install dependencies
run: pip install -r requirements-dev.txt

- name: Run tests with coverage
run: python -m pytest tests --cov=processing_engine --cov-report=term-missing --cov-report=json --cov-branch

- name: Extract coverage percentage
id: coverage
run: |
COVERAGE=$(python -c "import json; d=json.load(open('coverage.json')); print(round(d['totals']['percent_covered']))")
echo "percentage=${COVERAGE}" >> $GITHUB_OUTPUT
if [ "$COVERAGE" -ge 90 ]; then COLOR="brightgreen"
elif [ "$COVERAGE" -ge 80 ]; then COLOR="green"
elif [ "$COVERAGE" -ge 70 ]; then COLOR="yellow"
elif [ "$COVERAGE" -ge 50 ]; then COLOR="orange"
else COLOR="red"
fi
echo "color=${COLOR}" >> $GITHUB_OUTPUT

- name: Update coverage badge
if: github.ref == 'refs/heads/main'
uses: Schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: ${{ secrets.GIST_ID }}
filename: scampi_coverage.json
label: coverage
message: ${{ steps.coverage.outputs.percentage }}%
color: ${{ steps.coverage.outputs.color }}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
![Tests](https://github.com/HicResearch/SCAMPI/actions/workflows/tests.yml/badge.svg)
![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/JFriel/ef302fe4cee3248c4974297ba157016c/raw/scampi_coverage.json)
![Docker Hub](https://img.shields.io/docker/v/taggenblu/scampi)

# SCAMPI

SCAMPI is a DICOM processing engine that extracts DICOM files from a source (local filesystem or PACS server), reads their metadata, and writes the metadata to a SQL Server database alongside copying the files to an output directory.
Expand Down
Loading