|
| 1 | +name: system tests with matlab |
| 2 | + |
| 3 | +# Uses the cron schedule for github actions |
| 4 | +# |
| 5 | +# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events |
| 6 | +# |
| 7 | +# ┌───────────── minute (0 - 59) |
| 8 | +# │ ┌───────────── hour (0 - 23) |
| 9 | +# │ │ ┌───────────── day of the month (1 - 31) |
| 10 | +# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) |
| 11 | +# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) |
| 12 | +# │ │ │ │ │ |
| 13 | +# │ │ │ │ │ |
| 14 | +# │ │ │ │ │ |
| 15 | +# * * * * * |
| 16 | + |
| 17 | +on: |
| 18 | + |
| 19 | + push: |
| 20 | + branches: |
| 21 | + - main |
| 22 | + - dev |
| 23 | + paths: |
| 24 | + - '**.m' |
| 25 | + - '.github/workflows/*system*' |
| 26 | + pull_request: |
| 27 | + branches: |
| 28 | + - main |
| 29 | + paths: |
| 30 | + - '**.m' |
| 31 | + - '.github/workflows/*system*' |
| 32 | + schedule: |
| 33 | + - cron: "0 0 1,15 * *" |
| 34 | + |
| 35 | + # Allows you to run this workflow manually from the Actions tab |
| 36 | + workflow_dispatch: |
| 37 | + |
| 38 | +jobs: |
| 39 | + |
| 40 | + system_tests_matlab: |
| 41 | + |
| 42 | + # only trigger update on upstream repo |
| 43 | + if: github.repository_owner == 'cpp-lln-lab' |
| 44 | + |
| 45 | + runs-on: ubuntu-20.04 |
| 46 | + |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + script: [moae, facerep, fmriprep] |
| 50 | + fail-fast: false |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + sudo apt-get -y -qq update |
| 56 | + sudo apt-get -y install unzip wget |
| 57 | +
|
| 58 | + - name: Install MATLAB |
| 59 | + uses: matlab-actions/setup-matlab@v1.0.1 |
| 60 | + with: |
| 61 | + # MATLAB release to set up R2020a |
| 62 | + release: R2020a |
| 63 | + |
| 64 | + - name: Clone cpp_spm |
| 65 | + uses: actions/checkout@v3 |
| 66 | + with: |
| 67 | + submodules: true |
| 68 | + fetch-depth: 2 |
| 69 | + |
| 70 | + # Prep for later |
| 71 | + # - name: Install datalad |
| 72 | + # run: | |
| 73 | + # sudo apt-get -y -qq update |
| 74 | + # sudo apt-get -y install datalad |
| 75 | + # - name: Info |
| 76 | + # run: | |
| 77 | + # datalad --version |
| 78 | + # - name: Get fmriprep data |
| 79 | + # run: | |
| 80 | + # cd demos/ |
| 81 | + # datalad install --source https://gin.g-node.org/SPM_datasets/spm_moae_fmriprep.git \ |
| 82 | + # inputs/fmriprep |
| 83 | + # cd inputs/fmriprep && datalad get *.json \ |
| 84 | + # */*/*tsv \ |
| 85 | + # */*/*json \ |
| 86 | + # */*/*desc-preproc*.nii.gz \ |
| 87 | + # */*/*desc-brain*.nii.gz |
| 88 | + |
| 89 | + - name: Get moae fmriprep data from OSF |
| 90 | + run: | |
| 91 | + mkdir -p demos/MoAE/inputs/ |
| 92 | + cd demos/MoAE/inputs/ |
| 93 | + wget https://osf.io/vufjs/download |
| 94 | + unzip download |
| 95 | + mv moae_fmriprep fmriprep |
| 96 | +
|
| 97 | + - name: Install SPM |
| 98 | + run: | |
| 99 | + git clone https://github.com/spm/spm12.git --depth 1 |
| 100 | +
|
| 101 | + - name: Copy Macs toolbox to SPM inputs_folder |
| 102 | + run: cp -rv lib/MACS spm12/toolbox/MACS |
| 103 | + |
| 104 | + - name: Run ${{ matrix.script }} |
| 105 | + uses: matlab-actions/run-command@v1.0.1 |
| 106 | + with: |
| 107 | + command: cd(fullfile(getenv('GITHUB_WORKSPACE'), '.github', 'workflows')); run system_tests_${{ matrix.script }}; |
0 commit comments