Skip to content

add GH workflow

add GH workflow #2

Workflow file for this run

---
name: test latest image
on:
push:
branches: ['*']
schedule:
- cron: 0 0 1 * *
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
test_latest_image:
strategy:
matrix:
dataset: ['1', '2']
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y tree
- name: Clone repo
uses: actions/checkout@v3
- name: pull docker image
run: docker pull bids/freesurfer:latest
- name: add license
run: |
mkdir -p ~/license
echo "cHJpbnRmICJEeWxhbi5OaWVsc29uQGdtYWlsLmNvbVxuMzcwNjNcbiAqQ1lrZWhQYUNvRDlNXG4gRlM2N1BTWmRFV2lqb1xuIiA+IH4vbGljZW5zZS9saWNlbnNlLnR4dA==" | base64 -d | sh
- name: print version
run: |
docker run -ti --rm --read-only \
bids/freesurfer:latest --version
docker run -ti --rm --read-only \
bids/freesurfer:latest --help
- name: get data
run: |
wget https://raw.githubusercontent.com/bids-apps/maintenance-tools/main/utils/get_data_from_osf.sh
bash get_data_from_osf.sh ds114_test${{ matrix.dataset }}
bash get_data_from_osf.sh ds114_test${{ matrix.dataset }}_freesurfer_precomp_v6.0.0
- name: prepare output dir
run: mkdir -p ${HOME}/outputs${{ matrix.dataset }}
- name: participant 01
run: |
docker run -t --rm --read-only \
-v ${HOME}/data/ds114_test${{ matrix.dataset }}:/bids_dataset \
-v ${HOME}/outputs${{ matrix.dataset }}:/outputs \
-v ${HOME}/license/license.txt:/license.txt \
--tmpfs /tmp \
--tmpfs /var/tmp \
bids/freesurfer:latest \
/bids_dataset /outputs participant \
--license_file=/license.txt --stages autorecon1
cat ${HOME}/outputs${{ matrix.dataset }}/sub-01/scripts/recon-all.done
- name: check output
run: tree ${HOME}/outputs${{ matrix.dataset }}