forked from mne-tools/mne-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub_actions_test.sh
executable file
·31 lines (28 loc) · 1.06 KB
/
github_actions_test.sh
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
#!/bin/bash
set -eo pipefail
if [[ "${CI_OS_NAME}" == "ubuntu"* ]]; then
CONDITION="not (ultraslowtest or pgtest)"
else # macOS or Windows
CONDITION="not (slowtest or pgtest)"
fi
if [ "${MNE_CI_KIND}" == "notebook" ]; then
USE_DIRS=mne/viz/
else
USE_DIRS="mne/"
fi
JUNIT_PATH="junit-results.xml"
if [[ ! -z "$CONDA_ENV" ]] && [[ "${RUNNER_OS}" != "Windows" ]]; then
JUNIT_PATH="$(pwd)/${JUNIT_PATH}"
# Use the installed version after adding all (excluded) test files
cd ..
INSTALL_PATH=$(python -c "import mne, pathlib; print(str(pathlib.Path(mne.__file__).parents[1]))")
echo "Copying tests from $(pwd)/mne-python/mne/ to ${INSTALL_PATH}/mne/"
echo "::group::rsync"
rsync -a --partial --progress --prune-empty-dirs --exclude="*.pyc" --include="**/" --include="**/tests/*" --include="**/tests/data/**" --exclude="**" ./mne-python/mne/ ${INSTALL_PATH}/mne/
echo "::endgroup::"
cd $INSTALL_PATH
echo "Executing from $(pwd)"
fi
set -x
pytest -m "${CONDITION}" --tb=short --cov=mne --cov-report xml --color=yes --junit-xml=$JUNIT_PATH -vv ${USE_DIRS}
set +x