Skip to content

docs: add live demo url and dashboard screenshot #121

docs: add live demo url and dashboard screenshot

docs: add live demo url and dashboard screenshot #121

Workflow file for this run

name: imgshape CI
on:
push:
branches: ["master", "main"]
pull_request:
branches: ["master", "main"]
concurrency:
group: imgshape-ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
fail-fast: false
env:
PIP_EXTRA_INDEX_URL: ""
PYTHONUNBUFFERED: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
cache: "pip"
- name: Cache pip cache (explicit)
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml','**/setup.py','**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: Install system deps (robust apt-get)
shell: bash
run: |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
APT_OPTS="-o Acquire::Retries=3 -o Acquire::http::Timeout=60 -o Acquire::https::Timeout=60"
echo "Updating apt indexes (retries=3)..."
attempt=0; max=3
until [ $attempt -ge $max ]
do
attempt=$((attempt+1))
if sudo apt-get $APT_OPTS update -qq; then
echo "apt-get update succeeded on attempt $attempt"
break
else
echo "apt-get update failed on attempt $attempt; sleeping before retry..."
sleep $((attempt * 4))
fi
done
echo "Installing minimal runtime libs (no recommends) ..."
sudo apt-get install -y --no-install-recommends libgl1 libglib2.0-0 ca-certificates || {
echo "apt-get install failed — printing apt logs for debugging" >&2
apt-cache policy libgl1 || true
exit 1
}
echo "apt-get step completed"
- name: Upgrade pip / build tools
shell: bash
run: |
python -m pip install --upgrade pip wheel setuptools build
- name: Install package in editable mode with extras (dev + full)
shell: bash
run: |
pip install -e ".[dev,full]" || pip install -e ".[dev]"
- name: Prepare test image
shell: bash
run: |
set -euo pipefail
mkdir -p sample tmp
if [ -f assets/sample_images/Image_created_with_a_mobile_phone.png ]; then
cp assets/sample_images/Image_created_with_a_mobile_phone.png sample/test.png
else
RAW="https://raw.githubusercontent.com/STiFLeR7/imgshape/master/assets/sample_images/Image_created_with_a_mobile_phone.png"
curl -fsSLo sample/test.png "$RAW" || true
if [ ! -f sample/test.png ]; then
echo "Primary sample image not available; using Wikimedia fallback"
curl -fsSLo sample/test.png https://upload.wikimedia.org/wikipedia/commons/7/77/Delete_key1.jpg || true
fi
fi
ls -l sample || true
- name: Lint (flake8) — non-blocking
shell: bash
run: |
pip install flake8
flake8 src tests || true
- name: Type-check (mypy) — non-blocking
shell: bash
run: |
pip install mypy
mypy src || true
# ---- CLI Smoke Tests ----
- name: CLI Test - Help
run: imgshape --help
- name: CLI Test - Version (non-blocking)
run: imgshape --version || true
- name: CLI Test - Shape detection
run: python -m imgshape.cli --path sample/test.png --shape
- name: CLI Test - Analysis
run: python -m imgshape.cli --path sample/test.png --analyze
- name: CLI Test - Recommendation
run: python -m imgshape.cli --path sample/test.png --recommend --augment
- name: CLI Test - Report (Markdown) (non-blocking)
run: python -m imgshape.cli --path sample --report --augment --out tmp/ci_report.md || true
- name: CLI Test - Report (HTML) (non-blocking)
run: python -m imgshape.cli --path sample --report --augment --out tmp/ci_report.html || true
- name: CLI Test - Visualization (non-blocking) — run script
shell: bash
run: |
# run deterministic script that attempts to generate an interactive plot (if viz available)
mkdir -p .github/scripts
python .github/scripts/plot_test.py || true
- name: CLI Test - Model Compatibility (non-blocking)
run: python -m imgshape.cli --dir sample --check mobilenet_v2 || true
- name: CLI Test - TorchLoader (transform snippet) (non-blocking)
run: python -m imgshape.cli --path sample --torchloader --out tmp/transform_snippet.py || true
# ---- v4 Atlas Tests ----
- name: CLI Test - v4 Fingerprint
run: imgshape --fingerprint --path sample --out tmp/v4_fingerprint.json
- name: CLI Test - v4 Atlas Analyze
run: imgshape --atlas --path sample --intent training --out tmp/v4_analysis.json
- name: CLI Test - v4 Decisions
run: imgshape --decisions --path sample --intent training --out tmp/v4_decisions.json
- name: Run pytest (all tests)
run: pytest -q --disable-warnings --maxfail=1
- name: Run pytest (v4 tests only)
run: pytest tests/v4_test.py -v --disable-warnings
- name: Build distributions
run: python -m build
- name: Twine check
run: |
pip install twine
twine check dist/*
- name: Collect logs & reports (always)
if: always()
shell: bash
run: |
mkdir -p tmp
if [ ! -f pytest-report.xml ]; then
echo "<testsuites/>" > pytest-report.xml
fi
ls -la dist/ || true
ls -la tmp/ || true
echo "Files ready for upload:"
find dist/ tmp/ -type f 2>/dev/null | head -20 || true
- name: Upload artifacts (test logs + distributions)
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-artifacts-py${{ matrix.python-version }}
path: |
dist/
tmp/
pytest-report.xml
retention-days: 30
if-no-files-found: warn
- name: Cleanup (best-effort)
if: always()
run: |
rm -rf .pytest_cache || true
du -sh tmp || true