-
Notifications
You must be signed in to change notification settings - Fork 12
106 lines (91 loc) · 3.19 KB
/
cli-integration.yml
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
name: Test Integration with dandi-cli
on:
push:
branches:
- master
paths-ignore:
- "web/**"
pull_request:
paths-ignore:
- "web/**"
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Check out this repository
uses: actions/checkout@v2
- name: Build Docker image
run: |
docker build \
-t dandiarchive/dandiarchive-api \
-f dev/django-public.Dockerfile \
.
- name: Export Docker image
run: |
docker image save -o dandiarchive-api.tgz dandiarchive/dandiarchive-api
- name: Upload Docker image tarball
uses: actions/upload-artifact@v2
with:
name: dandiarchive-api.tgz
path: dandiarchive-api.tgz
test:
runs-on: ubuntu-latest
needs: build-image
strategy:
fail-fast: false
matrix:
python:
- 3.9
dandi-version:
- release
- master
env:
DANDI_ALLOW_LOCALHOST_URLS: 1
steps:
- name: Download Docker image tarball
uses: actions/download-artifact@v2
with:
name: dandiarchive-api.tgz
- name: Import Docker image
run: docker image load -i dandiarchive-api.tgz
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install hdf5
if: matrix.python == '3.9'
run: sudo apt-get update && sudo apt-get install -y libhdf5-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
# As of 2021-02-01, the latest version of hdmf (v2.3.0) requires
# numpy >=1.16, <1.19.4, so we end up with numpy 1.19.3 installed.
# However, due to the release of numpy 1.20.0 on January 30, h5py
# gets built against the later version instead, and because numpy
# 1.20.0 changed the size of ndarray, an error results at runtime.
# This can be worked around by installing numpy before the other
# dependencies so that it is available when h5py is built.
pip install 'numpy<1.19.4'
- name: Install released dandi
if: matrix.dandi-version == 'release'
run: pip install "dandi[test]"
- name: Install dev dandi
if: matrix.dandi-version == 'master'
run: pip install "dandi[test] @ git+https://github.com/dandi/dandi-cli"
- name: Run dandi-api tests in dandi-cli
run: |
python -m pytest -s -v --dandi-api \
"$pythonLocation/lib/python${{ matrix.python }}/site-packages/dandi"
env:
DANDI_TESTS_PERSIST_DOCKER_COMPOSE: "1"
- name: Dump Docker Compose logs
if: failure()
run: |
docker-compose \
-f "$pythonLocation/lib/python${{ matrix.python }}/site-packages/dandi/tests/data/dandiarchive-docker/docker-compose.yml" \
logs --timestamps
- name: Shut down Docker Compose
run: |
docker-compose \
-f "$pythonLocation/lib/python${{ matrix.python }}/site-packages/dandi/tests/data/dandiarchive-docker/docker-compose.yml" \
down -v