Skip to content

Commit

Permalink
Merge pull request #180 from mgxd/enh/manual-trigger
Browse files Browse the repository at this point in the history
ENH: Allow GH Action to run with manual trigger
  • Loading branch information
djarecka authored Sep 15, 2022
2 parents 650ff45 + b574d85 commit 901ae72
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
nipype_branch:
description: 'Build specific Nipype branch'
required: true
default: 'master'


jobs:
Expand All @@ -14,7 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: generate the Dockerfile from generate.sh
run: bash generate.sh
run: |
BRANCH=${{ github.event.inputs.nipype_branch }}
BRANCH=${BRANCH:-"master"}
bash generate.sh $BRANCH
# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
Expand Down
16 changes: 13 additions & 3 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

set -e

NIPYPE_BRANCH=${1:-"master"}
case $NIPYPE_BRANCH in
master)
NIPYPE_URL="https://github.com/nipy/nipype/tarball/master"
;;
*)
NIPYPE_URL="git+https://github.com/nipy/nipype.git@${NIPYPE_BRANCH}"
;;
esac

# Generate Dockerfile
generate_docker() {
docker run --rm kaczmarj/neurodocker:master generate docker \
Expand All @@ -17,7 +27,7 @@ generate_docker() {
--miniconda \
conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
pip_install="https://github.com/nipy/nipype/tarball/master
pip_install="$NIPYPE_URL
pybids==0.13.1
nilearn datalad[full] nipy duecredit nbval niflow-nipype1-workflows" \
create_env="neuro" \
Expand Down Expand Up @@ -54,9 +64,9 @@ generate_singularity() {
--user=neuro \
--workdir /home/neuro \
--miniconda \
conda_install="python=3.7 pytest jupyter jupyterlab jupyter_contrib_nbextensions
conda_install="python=3.8 pytest jupyter jupyterlab jupyter_contrib_nbextensions
traits pandas matplotlib scikit-learn scikit-image seaborn nbformat nb_conda" \
pip_install="https://github.com/nipy/nipype/tarball/master
pip_install="$NIPYPE_URL
pybids==0.13.1
nilearn datalad[full] nipy duecredit nbval niflow-nipype1-workflows" \
create_env="neuro" \
Expand Down

0 comments on commit 901ae72

Please sign in to comment.