Test #1344
This file contains 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: 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 | |
pip-flags: "--pre" | |
name: "Python 3.12 (pre-release)" | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Get pip cache dir | |
id: pip-cache-dir | |
run: | | |
echo "::set-output name=dir::$(pip cache dir)" | |
- name: Restore pip cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.pip-cache-dir.outputs.dir }} | |
key: pip-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
pip-${{ runner.os }}-${{ env.pythonLocation }}- | |
- name: Install dependencies | |
run: | | |
./.scripts/ci/install_dependencies.sh | |
- name: Install pip dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Restore data cache | |
id: data-cache | |
uses: actions/cache@v3 | |
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@v3 | |
with: | |
path: .tox | |
key: tox-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt', '**/tox.ini') }} | |
- name: Test | |
timeout-minutes: 60 | |
env: | |
MPLBACKEND: agg | |
PLATFORM: ${{ matrix.os }} | |
DISPLAY: :42 | |
run: | | |
tox -vv | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
name: coverage | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} # required |