-
Notifications
You must be signed in to change notification settings - Fork 190
175 lines (171 loc) · 8.67 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Full spikeinterface tests
on:
pull_request:
types: [synchronize, opened, reopened]
branches:
- main
concurrency: # Cancel previous workflows on the same pull request
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env: # For the sortingview backend
KACHERY_CLOUD_CLIENT_ID: ${{ secrets.KACHERY_CLOUD_CLIENT_ID }}
KACHERY_CLOUD_PRIVATE_KEY: ${{ secrets.KACHERY_CLOUD_PRIVATE_KEY }}
jobs:
full-tests-depending-on-changed-files:
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@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Get current year-month
id: date
run: echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
- name: Restore cached virtual environment with dependencies
uses: actions/cache/restore@v4
id: cache-venv
with:
path: ${{ github.workspace }}/test_env
key: ${{ runner.os }}-venv-${{ hashFiles('**/pyproject.toml') }}-${{ steps.date.outputs.date }}
- name: Get ephy_testing_data current head hash
# the key depends on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
id: vars
run: |
echo "HASH_EPHY_DATASET=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
- name: Restore cached gin data for extractors tests
uses: actions/cache/restore@v4
id: cache-datasets
env:
# the key depends on the last comit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
HASH_EPHY_DATASET: git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1
with:
path: ~/spikeinterface_datasets
key: ${{ runner.os }}-datasets-${{ steps.vars.outputs.HASH_EPHY_DATASET }}
restore-keys: ${{ runner.os }}-datasets
- name: Install packages
uses: ./.github/actions/build-test-environment
- name: Shows installed packages by pip, git-annex and cached testing files
uses: ./.github/actions/show-test-environment
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
- name: Module changes
id: modules-changed
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
if [[ $file == *"pyproject.toml" ]]; then
echo "pyproject.toml changed"
echo "CORE_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/core/"* || $file == *"/extractors/neoextractors/neobaseextractor.py" ]]; then
echo "Core changed"
echo "CORE_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/extractors/"* ]]; then
echo "Extractors changed"
echo "EXTRACTORS_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"plexon2"* ]]; then
echo "Plexon2 changed"
echo "PLEXON2_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/preprocessing/"* ]]; then
echo "Preprocessing changed"
echo "PREPROCESSING_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/postprocessing/"* ]]; then
echo "Postprocessing changed"
echo "POSTPROCESSING_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/qualitymetrics/"* ]]; then
echo "Quality metrics changed"
echo "QUALITYMETRICS_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/sorters/"* && $file != *"/sorters/internal/"* && $file != *"/sorters/external/"* ]]; then
echo "Sorters changed"
echo "SORTERS_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/sorters/external"* ]]; then
echo "External sorters changed"
echo "SORTERS_EXTERNAL_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/sorters/internal"* ]]; then
echo "Internal sorters changed"
echo "SORTERS_INTERNAL_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/comparison/"* ]]; then
echo "Comparison changed"
echo "COMPARISON_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/curation/"* ]]; then
echo "Curation changed"
echo "CURATION_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/widgets/"* ]]; then
echo "Widgets changed"
echo "WIDGETS_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/exporters/"* ]]; then
echo "Exporters changed"
echo "EXPORTERS_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/sortingcomponents/"* ]]; then
echo "Sortingcomponents changed"
echo "SORTINGCOMPONENTS_CHANGED=true" >> $GITHUB_OUTPUT
fi
if [[ $file == *"/generation/"* ]]; then
echo "Generation changed"
echo "GENERATION_CHANGED=true" >> $GITHUB_OUTPUT
fi
done
- name: Set execute permissions on run_tests.sh
run: chmod +x .github/run_tests.sh
- name: Install Wine (Plexon2)
if: ${{ steps.modules-changed.outputs.PLEXON2_CHANGED == 'true' }}
uses: ./.github/actions/install-wine
- name: Test core
run: ./.github/run_tests.sh core
- name: Test extractors
env:
HDF5_PLUGIN_PATH: ${{ github.workspace }}/hdf5_plugin_path_maxwell
if: ${{ steps.modules-changed.outputs.EXTRACTORS_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh "extractors and not streaming_extractors"
- name: Test preprocessing
if: ${{ steps.modules-changed.outputs.PREPROCESSING_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh "preprocessing and not deepinterpolation"
- name: Test postprocessing
if: ${{ steps.modules-changed.outputs.POSTPROCESSING_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh postprocessing
- name: Test quality metrics
if: ${{ steps.modules-changed.outputs.QUALITYMETRICS_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh qualitymetrics
- name: Test core sorters
if: ${{ steps.modules-changed.outputs.SORTERS_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh sorters
- name: Test comparison
if: ${{ steps.modules-changed.outputs.COMPARISON_CHANGED == 'true' || steps.modules-changed.outputs.GENERATION_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh comparison
- name: Test curation
if: ${{ steps.modules-changed.outputs.CURATION_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh curation
- name: Test widgets
if: ${{ steps.modules-changed.outputs.WIDGETS_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' || steps.modules-changed.outputs.QUALITYMETRICS_CHANGED == 'true' || steps.modules-changed.outputs.PREPROCESSING_CHANGED == 'true'}}
run: ./.github/run_tests.sh widgets
- name: Test exporters
if: ${{ steps.modules-changed.outputs.EXPORTERS_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' || steps.modules-changed.outputs.WIDGETS_CHANGED == 'true' }}
run: ./.github/run_tests.sh exporters
- name: Test sortingcomponents
if: ${{ steps.modules-changed.outputs.SORTINGCOMPONENTS_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh sortingcomponents
- name: Test internal sorters
if: ${{ steps.modules-changed.outputs.SORTERS_INTERNAL_CHANGED == 'true' || steps.modules-changed.outputs.SORTINGCOMPONENTS_CHANGED || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh sorters_internal
- name: Test generation
if: ${{ steps.modules-changed.outputs.GENERATION_CHANGED == 'true' || steps.modules-changed.outputs.CORE_CHANGED == 'true' }}
run: ./.github/run_tests.sh generation