Skip to content

Commit

Permalink
Merge pull request #237 from smoia/auto
Browse files Browse the repository at this point in the history
Fix TravisCI configuration for auto
  • Loading branch information
Stefano Moia authored Jun 15, 2020
2 parents f6fc624 + f9ff4fe commit 3895f76
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,23 @@ 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;
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

Expand All @@ -80,18 +75,31 @@ 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;
fi

script:
- |
CHECK_BRANCH=$( git branch | grep \*);
echo "**********";
echo "******";
echo "**";
if [ "${CHECK_BRANCH:20}" == "FETCH_HEAD)" ]; then
echo "!!! On branch ${CHECK_BRANCH}, this should be a **test for submitted PR**";
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
Expand All @@ -106,10 +114,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;
Expand Down

0 comments on commit 3895f76

Please sign in to comment.