-
Notifications
You must be signed in to change notification settings - Fork 15
133 lines (118 loc) · 4.11 KB
/
test-dandi-cli.yml
File metadata and controls
133 lines (118 loc) · 4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
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_TESTS_PULL_DOCKER_COMPOSE: 0
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
python:
# Use the only Python which is ATM also used by dandi-api
# - '3.10'
- '3.11'
# - '3.12'
version:
- master
- release
mode:
- normal
vendored_dandiapi:
# Allow vendor information for the dandi-api instance to default to
# the default values specified in
# dandi/tests/data/dandiarchive-docker/docker-compose.yml of the dandi-cli
# repo.
- default
include:
- os: ubuntu-latest
python: "3.10"
mode: dandi-devel
version: master
- os: ubuntu-latest
python: "3.10"
mode: dandi-devel
version: release
- os: ubuntu-latest
python: "3.11"
mode: normal
version: master
vendored_dandiapi: ember-dandi
instance_name: EMBER-DANDI
instance_identifier: 'RRID:SCR_026700'
doi_prefix: '10.82754'
- os: ubuntu-latest
python: "3.11"
mode: normal
version: release
vendored_dandiapi: ember-dandi
instance_name: EMBER-DANDI
instance_identifier: 'RRID:SCR_026700'
doi_prefix: '10.82754'
steps:
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
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 hdf5@1.8
brew link hdf5@1.8
- 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@v6
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
# Set only if matrix.instance_name is defined
- name: Set DANDI_TESTS_INSTANCE_NAME
if: ${{ matrix.instance_name }}
run: echo "DANDI_TESTS_INSTANCE_NAME=${{ matrix.instance_name }}" >> "$GITHUB_ENV"
# Set only if matrix.instance_identifier is defined
- name: Set DANDI_TESTS_INSTANCE_IDENTIFIER
if: ${{ matrix.instance_identifier }}
run: echo "DANDI_TESTS_INSTANCE_IDENTIFIER=${{ matrix.instance_identifier }}" >> "$GITHUB_ENV"
# Set only if matrix.doi_prefix is defined
- name: Set DANDI_TESTS_DOI_PREFIX
if: ${{ matrix.doi_prefix }}
run: echo "DANDI_TESTS_DOI_PREFIX=${{ matrix.doi_prefix }}" >> "$GITHUB_ENV"
- name: Run dandi-cli tests
run: python -m pytest -s -v --pyargs dandi