Skip to content
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

Auto deploy to gh pages #237

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
74 changes: 66 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,36 @@
language: generic
os:
- linux
- osx

env:
global:
- CONDA_ROOT=$HOME/miniconda
- TEST_ENV=test-env
- TEST_ENV_PREFIX=$CONDA_ROOT/envs/$TEST_ENV

- secure: XfurIBq0z+fiU8cRDdJB/ittCMZAmsOQHjeEVHIvAaJHEYthvqxMQURzP/+UiZ6Xn0ToDfFRm7CW0MDaYZvN7qX/MxVY7MhFtgFSk3YYOGDKeY7ODQuKMPsfiQPL+16AQB4OVO9ITiIgJSMlvitN0lfgZb4TXvcmZW0mfBAoNHc=
cache:
directories:
- CONDA_ROOT

# Default test stage, not in jobs, since multiple osses seem not to be supported there
os:
- linux
- osx

install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export MINICONDA=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export MINICONDA=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh; fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export MINICONDA=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh;
fi
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export MINICONDA=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh;
fi
- echo $CONDA_ROOT
- echo $TEST_ENV
- echo $TEST_ENV_PREFIX
- if [[ ! -d ${CONDA_ROOT} ]]; then
- |
if [[ ! -d ${CONDA_ROOT} ]]; then
echo "Installing Miniconda...";
wget $MINICONDA -O miniconda.sh &&
bash miniconda.sh -b -p ${CONDA_ROOT};
Expand All @@ -35,7 +45,8 @@ install:
# Useful for debugging any issues with conda
# - conda info -a

- if [[ ! -d $TEST_ENV_PREFIX ]]; then
- |
if [[ ! -d $TEST_ENV_PREFIX ]]; then
conda create -q -n $TEST_ENV -c ilastik-forge -c conda-forge ilastik-dependencies-no-solvers flake8 pytest-cov coveralls black;
else
conda install -y -n ${TEST_ENV} -c ilastik-forge -c conda-forge ilastik-dependencies-no-solvers flake8 pytest-cov coveralls black;
Expand All @@ -48,6 +59,7 @@ install:
- rm -rf ${TEST_ENV_PREFIX}/ilastik-meta/volumina
- ln -s $TRAVIS_BUILD_DIR ${TEST_ENV_PREFIX}/ilastik-meta/volumina


script:
- conda activate $TEST_ENV
- echo `which python`
Expand All @@ -56,3 +68,49 @@ script:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then xvfb-run pytest --capture=no --cov=volumina; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pytest --capture=no --cov=volumina; fi
- cd $TRAVIS_BUILD_DIR && git diff --name-only --diff-filter=AM master.. | grep ".*\.py" | xargs black --check


jobs:
include:
- stage: deploy
os:
- linux
on:
branch: master
condition: $TRAVIS_OS_NAME = "linux"
name: "Deploy github pages"
install:
- sudo apt-get update
- export MINICONDA=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
- echo $CONDA_ROOT
- |
if [[ ! -d ${CONDA_ROOT} ]]; then
echo "Installing Miniconda...";
wget $MINICONDA -O miniconda.sh &&
bash miniconda.sh -b -p ${CONDA_ROOT};
else
echo "Using cached Miniconda install";
fi
- echo ". $CONDA_ROOT/etc/profile.d/conda.sh" >> ~/.bashrc
- source ~/.bashrc
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- |
if [[ ! -d deploy ]]; then
conda create -q -n deploy -c ilastik-forge -c conda-forge ilastik-dependencies-no-solvers sphinx;
else
conda install -y -n deploy -c ilastik-forge -c conda-forge ilastik-dependencies-no-solvers sphinx;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to install ilastik deps in this case? Can we install only sphinx?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you spot every bit of lazyness I have in me. It didn't work without, so my quick fix was to download the whole thing. There are parts in docs/conf.py that require lazyflow for nicer display of string names or something... I'll investigate

fi
script:
- conda activate deploy
- cd docs
- make html
- touch _build/html/.nojekyll
deploy:
provider: pages
on:
branch: master
local_dir: docs/_build/html
name: ilastik-bot
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable