Skip to content

CI

CI #1760

Workflow file for this run

name: Test
on:
schedule:
- cron: 00 00 * * 1 # every Monday at 00:00
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
reason:
description: Reason for the workflow dispatch. Only "release" is valid.
required: true
default: release
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.11", "3.12"]
os: [ubuntu-latest]
include:
- python: "3.12"
os: macos-latest
pre-release: "allow"
name: "Python 3.12 (pre-release)"
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
UV_PRERELEASE: ${{ matrix.pre-release || 'disallow' }}
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python }}
enable-cache: true
- name: Install dependencies
run: |
./.scripts/ci/install_dependencies.sh
- name: Install pip dependencies
run: uv tool install tox --with=tox-uv --with=tox-gh-actions
- name: Restore data cache
id: data-cache
uses: actions/cache@v4
with:
path: |
~/.cache/squidpy/*.h5ad
key: data-${{ hashFiles('**/download_data.py') }}
- name: Download datasets
if: steps.data-cache.outputs.cache-hit != 'true'
run: |
tox -e download-data
# caching .tox is not encouraged, but since we're private and this shaves off ~1min from the step
# if any problems occur and/or once the package is public, this can be removed
- name: Restore tox cache
uses: actions/cache@v4
with:
path: .tox
key: tox-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('**/requirements.txt', '**/tox.ini') }}
- name: Test
timeout-minutes: 60
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
PYTEST_ADDOPTS: "-n auto"
run: |
tox -vv
# check if this can be deprecated
#- name: List figures for potential debugging
# ls -alh /home/runner/work/squidpy/squidpy/tests/figures
- name: Archive figures generated during testing
if: always()
uses: actions/upload-artifact@v4
with:
name: visual_test_results_${{ matrix.os }}-python${{ matrix.python }}
path: /home/runner/work/squidpy/squidpy/tests/figures/*
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
name: coverage
verbose: true
token: ${{ secrets.CODECOV_TOKEN }} # required
check:
if: always()
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}