Skip to content

ENH: Allow GH Action to run with manual trigger #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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