-
Notifications
You must be signed in to change notification settings - Fork 151
98 lines (95 loc) · 3.21 KB
/
github-actions-ci.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
name: ci/github-actions
on:
push:
branches:
- master
pull_request:
env:
TEST_NWB_FILES: skip
TEST_OBSERVATORY_EXPERIMENT_PLOTS_DATA: skip
TEST_API_ENDPOINT: http://api.brain-map.org
TEST_COMPLETE: false
TEST_BAMBOO: false
LIMS_DBNAME: db
LIMS_PORT: 1234
LIMS_PASSWORD: password
LIMS_HOST: host
LIMS_USER: user
MTRAIN_DBNAME: db
MTRAIN_USER: user
MTRAIN_HOST: host
MTRAIN_PORT: 1234
MTRAIN_PASSWORD: password
jobs:
lint:
name: Lint
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v2
- name: flake8 linting
run: |
pip install flake8
export PATH="/home/runner/.local/bin:${PATH}"
git fetch origin master
# `|| true` to force exit code 0 even if no files found
CHANGED_PYFILES=$(git diff --name-only --diff-filter AM origin/master allensdk | grep -e ".*.py$" || true)
echo "List of changed files:"
echo ${CHANGED_PYFILES}
flake8 ${CHANGED_PYFILES} --count
allensdk:
name: ${{ matrix.python-version }}, ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macos-latest", "windows-latest", "ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9"]
fail-fast: false
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: test-env
- name: Install
run: |
conda activate test-env
pip install codecov
pip install -r test_requirements.txt
pip install .
- name: Test
run: |
py.test --cov=allensdk -n 4
onprem:
name: python ${{ matrix.image }} on-prem test
runs-on: ["self-hosted"]
strategy:
matrix:
image: ["allensdk_local_py38:latest"]
steps:
- uses: actions/checkout@v2
- name: run test in docker
run: |
docker run \
--env-file /home/github_worker/env.list \
--mount type=bind,source=$PWD,target=/home/ghworker,bind-propagation=rshared \
--mount type=bind,source=/data/informatics/module_test_data/,target=/data/informatics/module_test_data/,bind-propagation=rshared,ro \
--mount type=bind,source=/allen/,target=/allen/,bind-propagation=rshared,ro \
--mount type=tmpfs,destination=/tmp \
--rm \
${{ matrix.image }} \
/bin/bash -c "pip install -r requirements.txt; \
pip install -r test_requirements.txt; \
python -m pytest \
--log-level=INFO \
--capture=no \
--cov=allensdk \
--cov-config coveragerc \
--cov-report html \
--junitxml=test-reports/test.xml \
--boxed \
--numprocesses auto \
--durations=0"