ci #529
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: [main] | |
| types: [opened, synchronize, reopened] | |
| schedule: | |
| - cron: "0 0 * * 1,3,5" | |
| permissions: | |
| contents: write | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v3 | |
| - uses: pre-commit/action@v3.0.1 | |
| tests: | |
| needs: [pre-commit] | |
| name: "pytest and snakemake" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macOS-latest, windows-latest] | |
| python-version: ["3.11", "3.12", "3.13"] | |
| exclude: | |
| - os: macos-latest | |
| python-version: "3.13" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Miniconda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install extra dependencies | |
| run: uv sync --extra cellpose --dev && uv pip install 'snakemake>=7.32.4,<9.0' 'pulp<2.8' 'cellpose==3.1.1' | |
| - name: Tests | |
| run: uv run poe test | |
| - name: Snakemake | |
| run: cd workflow && uv run snakemake --config sdata_path=tuto.zarr --configfile=config/toy/cellpose.yaml --workflow-profile profile/ci -c1 | |
| test_wsi: | |
| needs: [pre-commit] | |
| name: "${{ matrix.os }} | pytest wsi" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macOS-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Install extra dependencies | |
| run: uv sync --extra wsi --dev && uv pip install 'openslide-bin==4.0.0.8' 'openslide-python==1.4.2' 'slideio==2.7.1' 'timm==1.0.21' | |
| - name: Tests | |
| run: uv run poe test_wsi | |
| test_cellpose_v4: | |
| needs: [pre-commit] | |
| name: "${{ matrix.os }} | pytest cellpose v4" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macOS-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Install extra dependencies | |
| run: uv sync --extra cellpose --dev | |
| - name: Tests | |
| run: uv run poe test_long | |
| test_pip_install: | |
| needs: [pre-commit] | |
| name: "${{ matrix.os }} | pytest with pip install" | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macOS-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install sopa with pip | |
| run: pip install -e . && pip install pytest-cov poethepoet | |
| - name: Run short tests | |
| run: poe test_short | |
| deploy-docs: | |
| needs: [tests, test_wsi, test_cellpose_v4, test_pip_install] | |
| if: contains(github.ref, 'tags') | |
| name: "Deploy documentation" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Install extra dependencies | |
| run: uv sync --dev | |
| - name: Build documentation | |
| run: uv run mkdocs gh-deploy --force | |
| pypi-release: | |
| needs: [tests, test_wsi, test_cellpose_v4, test_pip_install] | |
| if: contains(github.ref, 'tags') | |
| name: "PyPI release" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Build | |
| run: uv build | |
| - name: Publish | |
| run: uv publish -t ${{ secrets.PYPI_TOKEN }} |