Skip to content

Joss paper

Joss paper #4451

name: Quickstart Examples Validation
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
# Allow manual trigger
workflow_dispatch:
jobs:
validate-quickstart:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10", "3.12"]
steps:
- name: Checkout code
uses: actions/checkout@v4
timeout-minutes: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
timeout-minutes: 3
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
timeout-minutes: 5
- name: Cache uv dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/uv
.venv
key: ${{ runner.os }}-uv-quickstart-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-quickstart-${{ matrix.python-version }}-
${{ runner.os }}-uv-
timeout-minutes: 2
- name: Install system dependencies
run: |
sudo mkdir -p /etc/apt/apt.conf.d
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
echo 'Acquire::http::Timeout "30";' | sudo tee /etc/apt/apt.conf.d/80-timeout
echo 'Acquire::https::Timeout "30";' | sudo tee -a /etc/apt/apt.conf.d/80-timeout
sudo DEBIAN_FRONTEND=noninteractive apt-get update -y
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
gcc g++ build-essential
timeout-minutes: 10
- name: Install dependencies
run: |
uv venv --clear .venv
source .venv/bin/activate
# Install numpy and scipy first to avoid potential conflicts
uv pip install numpy scipy
uv pip install -e .
# Verify key dependencies
python -c "import numpy; print(f'numpy {numpy.__version__}')"
python -c "import scipy; print(f'scipy {scipy.__version__}')"
python -c "import networkx; print(f'networkx {networkx.__version__}')"
timeout-minutes: 15
- name: Validate quickstart examples
run: |
echo " Running quickstart examples..."
source .venv/bin/activate
# Verify imports work before running
python -c "from py3plex.algorithms.community_detection.multilayer_modularity import louvain_multilayer; print(' Import successful')"
cd examples
# Run getting_started examples to validate basic functionality
echo "Running getting_started examples..."
python getting_started/example_datasets.py
python getting_started/example_multilayer_functionality.py
python getting_started/example_random_generator.py
echo " Quickstart validation completed successfully"
timeout-minutes: 10
env:
# Use non-interactive backend for matplotlib
MPLBACKEND: Agg
- name: Check example outputs
run: |
echo " Checking generated outputs..."
if [ -d "example_images" ]; then
echo "Found example_images directory"
ls -lh example_images/*.png 2>/dev/null || echo "No PNG files generated"
else
echo "No example_images directory created (expected for quickstart examples)"
fi
echo " Output check complete"
timeout-minutes: 1
- name: Upload example artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: quickstart-outputs-py${{ matrix.python-version }}
path: example_images/*.png
if-no-files-found: ignore
retention-days: 7
timeout-minutes: 2