Skip to content

Test against dandi-cli #1142

Test against dandi-cli

Test against dandi-cli #1142

name: Test against dandi-cli
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 6 * * *'
jobs:
test-dandi-cli:
runs-on: ${{ matrix.os }}
env:
NO_ET: 1
DANDI_ALLOW_LOCALHOST_URLS: 1
DANDI_TESTS_PULL_DOCKER_COMPOSE: 0
strategy:
fail-fast: false
matrix:
os:
- windows-2019
- ubuntu-latest
- macos-latest
python:
# Use the only Python which is ATM also used by dandi-api
# - 3.7
- 3.8
# - 3.9
# - '3.10'
# - '3.11'
version:
- master
- release
mode:
- normal
include:
- os: ubuntu-latest
python: 3.8
mode: dandi-devel
version: master
- os: ubuntu-latest
python: 3.8
mode: dandi-devel
version: release
exclude:
# Temporarily disabled due to h5py/hdf5 dependency issue
# See <https://github.com/dandi/dandi-cli/pull/315>
- os: windows-2019
python: 3.9
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Update pip & install wheel
run: python -m pip install --upgrade pip wheel
- name: Install hdf5 (Ubuntu)
if: matrix.python == '3.10' && startsWith(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y libhdf5-dev
- name: Install hdf5 (macOS)
if: matrix.python == '3.10' && startsWith(matrix.os, 'macos')
run: |
brew install [email protected]
brew link [email protected]
- name: Install master branch of dandi
if: ${{ matrix.version == 'master' }}
run: pip install "dandi[test,extras] @ git+https://github.com/dandi/dandi-cli.git"
- name: Install latest release of dandi
if: ${{ matrix.version == 'release' }}
run: pip install "dandi[test,extras]"
- name: Set DANDI_DEVEL=1
if: matrix.mode == 'dandi-devel'
run: echo DANDI_DEVEL=1 >> "$GITHUB_ENV"
- name: Check out dandischema
uses: actions/checkout@v4
with:
# Fetch all commits so that versioningit will return something
# compatible with semantic-version
fetch-depth: 0
path: dandischema
- name: Install dandischema
run: pip install .
working-directory: dandischema
- name: Build dandi-api image with this version of dandischema
if: startsWith(matrix.os, 'ubuntu')
run: |
docker build \
-t dandiarchive/dandiarchive-api \
-f tools/api-with-schema.Dockerfile \
.
working-directory: dandischema
- name: Run dandi-cli tests
run: python -m pytest -s -v --pyargs dandi