forked from NeuralEnsemble/python-neo
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.49 KB
/
full-test.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
name: neo.io and neo.rawio tests
on:
pull_request:
branches: [master]
types: [synchronize, opened, reopened, ready_for_review]
# run checks on any change of master, including merge of PRs
push:
branches: [master]
jobs:
build-and-test:
name: Test on (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# "macos-latest", "windows-latest"
os: ["ubuntu-latest", ]
steps:
- uses: actions/checkout@v2
with:
python-version: 3.8
- name: Get current year-month
id: date
run: echo "::set-output name=date::$(date+'%Y-%m')"
- uses: actions/cache@v2
# the cache for python package is reset:
# * every month
# * when requirements/requirements_testing change
id: cache-venv
with:
path: ~/test_env
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements_testing.txt') }}-${{ steps.date.outputs.date }}
restore-keys: |
${{ runner.os }}-venv-
- name: Install dependencies
run: |
# this is for datalad and download testing datasets
sudo apt install git git-annex
# needed for correct operation of git/git-annex/DataLad
git config --global user.email "neo_ci@fake_mail.com"
git config --global user.name "neo CI"
# create an environment and install everything
python -m venv ~/test_env
source ~/test_env/bin/activate
python -m pip install --upgrade pip
# pip install -r requirements.txt
pip install -r requirements_testing.txt
pip install -e .
- name: Get ephy_testing_data current head hash
# the key depend on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
id: vars
run: |
echo "::set-output name=HASH_EPHY_DATASET::$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)"
- uses: actions/cache@v2
id: cache-datasets
with:
path: ~/ephy_testing_data
key: ${{ runner.os }}-datasets-${{ steps.vars.outputs.HASH_EPHY_DATASET }}
restore-keys: |
${{ runner.os }}-datasets
- name: Test with pytest
run: |
source ~/test_env/bin/activate
# only neo.rawio and neo.io
pytest --cov=neo neo/test/rawiotest
pytest --cov=neo neo/test/iotest