From 214151b96296a5cd891cb829d8c292544e643e0f Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Mon, 15 Jun 2020 13:26:31 +0200 Subject: [PATCH 1/5] Revert "Check branch EVERYWHERE" This reverts commit 1047f35171a380026ceec5281d7ea0a35f4ae544. --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d622e53cf..cc40dda47 100755 --- a/.travis.yml +++ b/.travis.yml @@ -51,18 +51,12 @@ before_install: python -m pip install --upgrade pip; fi - if [ "${CHECK_TYPE}" == "linting" ]; then - CHECK_BRANCH=$( git branch | grep \*); - echo "On branch ${CHECK_BRANCH}"; pip install flake8; fi - if [ "${CHECK_TYPE}" == "test" ]; then - CHECK_BRANCH=$( git branch | grep \*); - echo "On branch ${CHECK_BRANCH}"; pip install "pytest>=4.6" pytest-cov coverage coveralls codecov; fi - if [ "${CHECK_TYPE}" == "docdoctest" ]; then - CHECK_BRANCH=$( git branch | grep \*); - echo "On branch ${CHECK_BRANCH}"; pip install "sphinx>2.0" sphinx_rtd_theme pandas sphinx-argparse; fi From 61bf7e59906e23fcc99702f1af5760b928621c00 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Mon, 15 Jun 2020 14:06:17 +0200 Subject: [PATCH 2/5] Improve branch check and message --- .travis.yml | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc40dda47..cf4065609 100755 --- a/.travis.yml +++ b/.travis.yml @@ -41,11 +41,12 @@ matrix: before_install: - if [ "${CHECK_TYPE}" == "auto-svl" ]; then CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH}" == "* master" ]; then + if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + echo "!!! On branch ${CHECK_BRANCH}, skipping auto-svl"; + else + echo "!!! On branch ${CHECK_BRANCH}, preparing environment for auto-svl"; git config --local user.name "${GIT_NAME}"; git config --local user.email "${GIT_EMAIL}"; - else - echo "On branch ${CHECK_BRANCH}, skipping auto-svl"; fi; else python -m pip install --upgrade pip; @@ -74,11 +75,12 @@ install: pip install dist/*.whl; elif [ "${INSTALL_TYPE}" == "auto-svl" ]; then CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH}" == "* master" ]; then - curl -vkL -o - https://github.com/intuit/auto/releases/download/v9.39.0/auto-linux.gz | gunzip > build/auto; - chmod a+x build/auto; - else - echo "On branch ${CHECK_BRANCH}, skipping auto-svl"; + if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + echo "!!! On branch ${CHECK_BRANCH}, skipping auto-svl"; + else + echo "!!! On branch ${CHECK_BRANCH}, setting up auto-svl"; + curl -vkL -o - https://github.com/intuit/auto/releases/download/v9.39.0/auto-linux.gz | gunzip > build/auto; + chmod a+x build/auto; fi; else false; @@ -86,6 +88,17 @@ install: script: - | + CHECK_BRANCH=$( git branch | grep \*); + if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + echo "**********" + echo "******" + echo "**" + echo "!!! On branch ${CHECK_BRANCH}, this should be a **test for submitted PR**"; + echo "**" + echo "******" + echo "**********" + else + echo "!!! On branch ${CHECK_BRANCH}, this should be a **test after MERGE**"; if [ "${CHECK_TYPE}" == "linting" ]; then flake8 phys2bids; elif [ "${CHECK_TYPE}" == "docdoctest" ]; then @@ -100,10 +113,11 @@ script: python -m pytest ${args} phys2bids; elif [ "${CHECK_TYPE}" == "auto-svl" ]; then CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH}" == "* master" ]; then - build/auto shipit; - else - echo "Not on master branch, skipping auto-svl"; + if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + echo "!!! On branch ${CHECK_BRANCH}, skipping auto-svl"; + else + echo "!!! On branch ${CHECK_BRANCH}, run auto-svl!"; + build/auto shipit; fi; else false; From b0c365d3f71ed50403ddd22ccc0e5b0c043e2df4 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Mon, 15 Jun 2020 14:10:45 +0200 Subject: [PATCH 3/5] Correct quotation marks --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf4065609..3ee2d6450 100755 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ matrix: before_install: - if [ "${CHECK_TYPE}" == "auto-svl" ]; then CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then echo "!!! On branch ${CHECK_BRANCH}, skipping auto-svl"; else echo "!!! On branch ${CHECK_BRANCH}, preparing environment for auto-svl"; @@ -75,7 +75,7 @@ install: pip install dist/*.whl; elif [ "${INSTALL_TYPE}" == "auto-svl" ]; then CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then echo "!!! On branch ${CHECK_BRANCH}, skipping auto-svl"; else echo "!!! On branch ${CHECK_BRANCH}, setting up auto-svl"; @@ -89,7 +89,7 @@ install: script: - | CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then echo "**********" echo "******" echo "**" @@ -113,7 +113,7 @@ script: python -m pytest ${args} phys2bids; elif [ "${CHECK_TYPE}" == "auto-svl" ]; then CHECK_BRANCH=$( git branch | grep \*); - if [ "${CHECK_BRANCH:20} == "FETCH_HEAD)" ]; then + if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then echo "!!! On branch ${CHECK_BRANCH}, skipping auto-svl"; else echo "!!! On branch ${CHECK_BRANCH}, run auto-svl!"; From 923a564b866ea0bb4a4e6e50a2807a63b18efa9b Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Mon, 15 Jun 2020 14:18:06 +0200 Subject: [PATCH 4/5] Add semicolumns and fi --- .travis.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ee2d6450..d7407bcca 100755 --- a/.travis.yml +++ b/.travis.yml @@ -90,15 +90,16 @@ script: - | CHECK_BRANCH=$( git branch | grep \*); if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then - echo "**********" - echo "******" - echo "**" + echo "**********"; + echo "******"; + echo "**"; echo "!!! On branch ${CHECK_BRANCH}, this should be a **test for submitted PR**"; - echo "**" - echo "******" - echo "**********" + echo "**"; + echo "******"; + echo "**********"; else echo "!!! On branch ${CHECK_BRANCH}, this should be a **test after MERGE**"; + fi; if [ "${CHECK_TYPE}" == "linting" ]; then flake8 phys2bids; elif [ "${CHECK_TYPE}" == "docdoctest" ]; then From f9ff4fe30fa306fd3a4a38a30c734daaa92cb0c4 Mon Sep 17 00:00:00 2001 From: Stefano Moia Date: Mon, 15 Jun 2020 14:22:54 +0200 Subject: [PATCH 5/5] Better message --- .travis.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index d7407bcca..ba0246905 100755 --- a/.travis.yml +++ b/.travis.yml @@ -89,17 +89,17 @@ install: script: - | CHECK_BRANCH=$( git branch | grep \*); + echo "**********"; + echo "******"; + echo "**"; if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then - echo "**********"; - echo "******"; - echo "**"; echo "!!! On branch ${CHECK_BRANCH}, this should be a **test for submitted PR**"; - echo "**"; - echo "******"; - echo "**********"; else echo "!!! On branch ${CHECK_BRANCH}, this should be a **test after MERGE**"; fi; + echo "**"; + echo "******"; + echo "**********"; if [ "${CHECK_TYPE}" == "linting" ]; then flake8 phys2bids; elif [ "${CHECK_TYPE}" == "docdoctest" ]; then