Skip to content

Commit 2d6494e

Browse files
authored
MNT split the actions to run tests and tutorials (#36)
* MNT split the actions to run tests and tutorials * Simplify actions more * Install git-annex for datalad * Check if the tutorial data is cached for tests too
1 parent 709b08e commit 2d6494e

File tree

2 files changed

+65
-11
lines changed

2 files changed

+65
-11
lines changed

.github/workflows/run_tests.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,4 @@ jobs:
7373
fail_ci_if_error: true
7474
token: ${{ secrets.CODECOV_TOKEN }}
7575
verbose: false
76-
77-
- name: Run some tutorials
78-
run: |
79-
# run tutorials with a shortcut option to skip model fitting
80-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/00_download_shortclips.py
81-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/01_plot_explainable_variance.py
82-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/02_plot_ridge_regression.py
83-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/03_plot_wordnet_model.py
84-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/04_plot_hemodynamic_response.py
85-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/05_plot_motion_energy_model.py
86-
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/06_plot_banded_ridge_model.py
76+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Tutorials
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
run-tutorials:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.9, "3.10", "3.11", "3.12", "3.13"]
15+
max-parallel: 5
16+
fail-fast: true
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- uses: actions/cache@v4
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
32+
- uses: actions/cache@v4
33+
with:
34+
path: ~/voxelwise_tutorials_data/shortclips
35+
key: shortclips-dataset
36+
37+
- name: Install dependencies
38+
run: |
39+
pip install -U setuptools
40+
pip install -U wheel
41+
# install himalaya from source to get early testing
42+
pip install git+https://github.com/gallantlab/himalaya.git
43+
pip install -e ."[github]"
44+
# use neurodebian installer for travis
45+
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
46+
sudo apt-get update -qq
47+
sudo apt-get install git-annex-standalone
48+
49+
- name: Config git-annex
50+
run: |
51+
# add some git config for git-annex
52+
git config --global user.email "[email protected]"
53+
git config --global user.name "Github Actions"
54+
55+
- name: Run some tutorials
56+
run: |
57+
# run tutorials with a shortcut option to skip model fitting
58+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/00_download_shortclips.py
59+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/01_plot_explainable_variance.py
60+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/02_plot_ridge_regression.py
61+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/03_plot_wordnet_model.py
62+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/04_plot_hemodynamic_response.py
63+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/05_plot_motion_energy_model.py
64+
HIMALAYA_SKIP_FIT=True python tutorials/shortclips/06_plot_banded_ridge_model.py

0 commit comments

Comments
 (0)