-
Notifications
You must be signed in to change notification settings - Fork 162
156 lines (149 loc) · 5.33 KB
/
run_tutorial.yaml
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
# Workflow to test Brainstorm source on GitHub-Hosted Linux, Windows and macOS runners
# Workflow name
name: Run tutorial (on Brainstorm source)
# Parameters
env:
MATLAB_VER: R2021b # Oldest "b" release available for Windows runner
# When the workflow will run
on:
# Run on Push to a given branch
push:
branches:
- fake-branch
# Run manually from GitHub Actions tab, it must be in the default branch
workflow_dispatch:
# Inputs that appear on GitHub
inputs:
testname:
type: choice
description: Test to run
options:
- tutorial_introduction
- tutorial_connectivity
- tutorial_coherence
- tutorial_ephys
- tutorial_epilepsy
- tutorial_epileptogenicity
- tutorial_fem_tensors
- tutorial_neuromag
- tutorial_phantom_ctf
- tutorial_phantom_elekta
- tutorial_practicalmeeg
- tutorial_raw
- tutorial_resting
- tutorial_simulations
- tutorial_yokogawa
required: true
bstusername:
description: Brainstorm username to send email
required: true
default: ''
# Name for each run
run-name: "Run: ${{ github.event.inputs.testname }}"
jobs:
# Ubuntu job
Run-Ubuntu:
name: Run on Linux (Ubuntu 20.04)
runs-on: ubuntu-20.04
steps:
# Get the Brainstorm code to test
- name: Checkout 'brainstorm3' in 'brainstorm3'
uses: actions/checkout@v3
with:
path: brainstorm3
# Setting Matlab, if done after 2nd checkout, Matlab cannot find brainstorm.m
- name: Set up Matlab
uses: matlab-actions/setup-matlab@v1
with:
release: ${{ env.MATLAB_VER }}
# Get code to do the testing
- name: Checkout 'bst-tests' in 'bst-tests'
uses: actions/checkout@v3
with:
repository: brainstorm-tools/bst-tests
ref: 'main'
# TOKEN_BST_TEST is a PAT in secrets in brainstorm3
# TOKEN was create on rcassani account
token: ${{ secrets.TOKEN_BST_TEST }}
path: bst-tests
# Keep script at same level as brainstorm.m
- name: Create symbolic link for test_brainstorm.m
run: ln -s $GITHUB_WORKSPACE/bst-tests/test_brainstorm.m $GITHUB_WORKSPACE/brainstorm3/test_brainstorm.m
# Run testing
- name: Run script
uses: matlab-actions/run-command@v1
with:
command: cd("brainstorm3"), brainstorm test_brainstorm.m ${{ github.event.inputs.testname }} ${{ github.event.inputs.bstusername }} local
startup-options: -nodisplay
# macOS job
Run-MacOS:
name: Run on macOS (12 Monterey)
runs-on: macos-12
steps:
# Get the Brainstorm code to test
- name: Checkout 'brainstorm3' in 'brainstorm3'
uses: actions/checkout@v3
with:
path: brainstorm3
# Setting Matlab, if done after 2nd checkout, Matlab cannot find brainstorm.m
- name: Set up Matlab
uses: matlab-actions/setup-matlab@v1
with:
release: ${{ env.MATLAB_VER }}
# Get code to do the testing
- name: Checkout 'bst-tests' in 'bst-tests'
uses: actions/checkout@v3
with:
repository: brainstorm-tools/bst-tests
ref: 'main'
# TOKEN_BST_TEST is a PAT in secrets in brainstorm3
# TOKEN was create on rcassani account
token: ${{ secrets.TOKEN_BST_TEST }}
path: bst-tests
# Keep script at same level as brainstorm.m
- name: Create symbolic link for test_brainstorm.m
run: ln -s $GITHUB_WORKSPACE/bst-tests/test_brainstorm.m $GITHUB_WORKSPACE/brainstorm3/test_brainstorm.m
# Run testing
- name: Run script
uses: matlab-actions/run-command@v1
with:
command: cd("brainstorm3"), brainstorm test_brainstorm.m ${{ github.event.inputs.testname }} ${{ github.event.inputs.bstusername }} local
startup-options: -nodisplay
# Windows job
Run-Windows:
name: Run on Windows (Server 2019)
runs-on: windows-2019
steps:
# Get the Brainstorm code to test
- name: Checkout 'brainstorm3' in 'brainstorm3'
uses: actions/checkout@v3
with:
path: brainstorm3
# Setting Matlab, if done after 2nd checkout, Matlab cannot find brainstorm.m
- name: Set up Matlab
uses: matlab-actions/setup-matlab@v1
with:
release: ${{ env.MATLAB_VER }}
# Get code to do the testing
- name: Checkout 'bst-tests' in 'bst-tests'
uses: actions/checkout@v3
with:
repository: brainstorm-tools/bst-tests
ref: 'main'
# TOKEN_BST_TEST is a PAT in secrets in brainstorm3
# TOKEN was create on rcassani account
token: ${{ secrets.TOKEN_BST_TEST }}
path: bst-tests
# Keep script at same level as brainstorm.m
- name: Create symbolic link for test_brainstorm.m
shell: cmd
run: |
mklink %GITHUB_WORKSPACE%\brainstorm3\test_brainstorm.m %GITHUB_WORKSPACE%\bst-tests\test_brainstorm.m
pwd
dir
# Run testing
- name: Run script
uses: matlab-actions/run-command@v1
with:
command: cd("brainstorm3"), brainstorm test_brainstorm.m ${{ github.event.inputs.testname }} ${{ github.event.inputs.bstusername }} local
startup-options: -nodisplay