Skip to content

docs: sync all documentation with recent HPC and STFT optimizations #29

docs: sync all documentation with recent HPC and STFT optimizations

docs: sync all documentation with recent HPC and STFT optimizations #29

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: uv sync --dev
- name: Lint with ruff
run: uv run ruff check . --output-format=github
- name: Check formatting with ruff
run: uv run ruff format --check .
- name: Type check with mypy
run: uv run uvx ty check
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
exclude:
# Reduce matrix for faster CI - only test all Python versions on Ubuntu
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.10"
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 uv
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
cache-dependency-glob: "pyproject.toml"
- name: Install dependencies
run: uv sync --dev
- name: Run tests with coverage
run: |
uv run pytest tests \
--cov=DASMatrix \
--cov-report=xml \
--cov-report=term-missing \
--durations=10
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
security:
name: Security Scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --dev
- name: Run safety check
run: uv run safety check --json || true
continue-on-error: true
- name: Run bandit security scan
run: uv run bandit -r DASMatrix -f json || true
continue-on-error: true
build:
name: Build Package
runs-on: ubuntu-latest
needs: [code-quality, test]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Build package
run: uv build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-files
path: dist/
retention-days: 7
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
needs: [code-quality]
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --dev
- name: Run integration tests
run: |
# Test examples run without errors
for example in examples/*.py; do
echo "Testing $example"
timeout 30 uv run python "$example" || true
done
- name: Test package installation
run: |
uv build
cd /tmp
uv pip install --system $GITHUB_WORKSPACE/dist/*.whl
python -c "import DASMatrix; print('✅ Package imports successfully')"