Skip to content

Commit

Permalink
Merge pull request #39 from tovrstra/updateci
Browse files Browse the repository at this point in the history
Update CI to molmod bot
  • Loading branch information
molmod-bot authored Aug 29, 2017
2 parents 063c58b + 9cf327b commit 558d7fe
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 145 deletions.
45 changes: 26 additions & 19 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ environment:
# See: http://stackoverflow.com/a/13751649/163740
CMD_IN_ENV: 'cmd /E:ON /V:ON /C .\tools\appveyor\run_with_env.cmd'
ANACONDA_TOKEN:
secure: UMSXPRCnP38rwuIS4dAq/ukkO7MNo513Qn8XwLPrtGtbGA0QGEDx8aWUQMsLrlaK
secure: hkjyENhlvGf1C+qeTYgkU+ggPCmHAdAh8FCGJpdnEw8kmUJlqqDXfRWt94qE6W3Y
PYPKG: yaff
GITHUB_REPO_NAME: molmod/yaff

matrix:
- PYTHON_VERSION: 3.5
CONDA: C:\Miniconda35
# It is not possible to compile the Yaff extension on Windows for Python 2.7 because
# Python 2.7 on Windows is built with an old visual compiler, which does not even support
# C99! The C99 standard is extensively used in the Yaff extension.
# - PYTHON_VERSION: 2.7
# CONDA: C:\Miniconda

- PYTHON_VERSION: 3.6
CONDA: C:\Miniconda36

version: '{build}'
image: Visual Studio 2015

# For testing only...
#skip_non_tags: true

platform:
- x86
- x64
- x86
- x64

branches:
only:
Expand All @@ -44,7 +44,7 @@ install:
# Load the conda root environment, configure and install some packages
- '"%CONDA%\Scripts\activate.bat"'
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels tovrstra
- conda config --add channels molmod
- conda update -q conda
- conda install conda-build anaconda-client numpy cython
# Install codecov tool for uploading coverage reports
Expand All @@ -67,7 +67,9 @@ test_script:
- 'echo "backend:agg" > "%HOME%\.matplotlib\matplotlibrc"'

# Run the tests outside the source tree.
- pushd %HOMEPATH% && (nosetests %PYPKG% -v --detailed-errors --with-coverage --cover-package=%PYPKG% --cover-tests --cover-erase --cover-inclusive --cover-branches --cover-xml & popd)
- pushd "%HOMEPATH%" && (nosetests %PYPKG% -v --detailed-errors --with-coverage
--cover-package=%PYPKG% --cover-tests --cover-erase --cover-inclusive
--cover-branches --cover-xml & popd)

after_test:
# Copy the conda build to the home dir, such that it can be registerd as an artifact
Expand All @@ -80,21 +82,26 @@ artifacts:
- path: 'conda-bld\win-*\*.tar.bz2'

on_success:
# This is virtually impossible with a normal dos batch script...
# Upload to anaconda, with the correct label derived from the version tag.
# This is virtually impossible with a normal dos batch script...
# It also contains an incredibly clunky way to avoid build failure when anaconda writes
# something harmless to stderr. The normal way does not work!
# & anaconda $parameters 2>&1
# Powershell should be called Powerhell!
- ps:
if (($Env:APPVEYOR_REPO_TAG -eq "true") -and
($Env:APPVEYOR_REPO_NAME -eq ${Env:GITHUB_REPO_NAME})) {
$tar_glob = ".\conda-bld\win-*\${Env:PYPKG}-${Env:APPVEYOR_REPO_TAG_NAME}-*.tar.bz2";
Write-Host $tar_glob;
Write-Host "tar_glob $tar_glob";
if ($Env:APPVEYOR_REPO_TAG_NAME -like "*a*") {
Start-Process -FilePath anaconda -ArgumentList "-t $Env:ANACONDA_TOKEN upload
$tar_glob --no-progress -l alpha" -Wait -Passthru
$anaconda_label = "alpha"
} elseif ($Env:APPVEYOR_REPO_TAG_NAME -like "*b*") {
Start-Process -FilePath anaconda -ArgumentList "-t $Env:ANACONDA_TOKEN upload
$tar_glob --no-progress -l beta" -Wait -Passthru
$anaconda_label = "beta"
} else {
Start-Process -FilePath anaconda -ArgumentList "-t $Env:ANACONDA_TOKEN upload
$tar_glob --no-progress" -Wait -Passthru
}
$anaconda_label = "main"
};
Write-Host "anaconda_label $anaconda_label";
$parameters = '-t', "$Env:ANACONDA_TOKEN", 'upload', "$tar_glob", '-l',
"$anaconda_label", '--force', '--no-progress';
& cmd /c 'anaconda 2>&1' $parameters;
}
246 changes: 131 additions & 115 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
env:
matrix:
- MYCONDAPY=2.7
- MYCONDAPY=3.5
- MYCONDAPY=3.6
- MYCONDAPY=2.7
- MYCONDAPY=3.6
global:
# ANACONDA_TOKEN encrypted
- secure: "Qekvnk/wtRQyPxmNJC3aMcyiBdXW1K+oSK5d1X2+XggYxA2k28iwq2e08Tfym+jVpPybtvmK65rMJ40Zrgp67RCbpqDlcwkjN7k1DkyF3kIV9t9HOVRdXyaKqWfOYvZqmljeoywj4UlJnXBfZnlUdcaGIe0dnIN8P8GKxzjSeoo="
- secure: "Pgu8yuDay2kG1a+dnsgl3lBlGBDb6ifhMRzE1DqcRbCqplpCCgfxNL3Njt+sLtTWZ4jPPC4w0Z\
ZrrqnOg62G4CeZCfp7cznJvN82mwYtW4ThlszIdXRfR+QfS35xKkvfWCvMYX3qBJ8xx3ih+g2GXx5roTE/qq7GfzP\
uOa43jsw="
# GITHUB_TOKEN
- secure: "JNNWmIAoY7ysYoGylugSYce3w02ZwQVsFQkb4Nr40ZBiuZBkPKxQfmeyi6ReKieY6Q3za5Lz8vwaDodl1cHB3OQNkJR49l7m3AlXzBWAKzJTDl6N20el6gKQdgM3W0VaniomK6i/laOMIaNDU/f4nVehL8SwuSFooi69YGyuvrQ="
- secure: "Pjb4QTTTd1L0ssl5YGrFP/bQwGYOMICZVJJAndlv1o9VmR4o81Mddv2IgxELmFA0K0lO0tFPOc\
w8O69Oa/qnXsRKGF+05fMUKzb+If8yGoupVaa/FAGfha6/WNw+jnDqHUfXCI+nXySIRSk9kRfl0gH9LW0clSUF8dM\
MKC95+wg="
# PYPI_PASSWD
- secure: "X/3siVpfbJrMPQ0j5ky8nUKR/GQ5jY3R7vY1Fr7C2es5k+OZdZpdzgjto9eUDoTpm18EVYxu8b4xS98ws/FyhWaeRWwmqjpngQAJfM2YPCmsmSiGVbYo/w+3TDTMY2papj+fND0b8SYvW1lWjGB7VzXh9hNIbGWwD6TKmTQNyD8="
- secure: "fcr/ruryZctvHipyllH8rnGDpd8WH//zUo2dAzI0heqEqucx3BLZ9HbutPt0QmYirPNM/ywNfv\
RX93IhnyX5vGDsDfrcU7a69nsqHXapTEU04BcYH8MOPFvakf/s8k7biMeZCqZ4C3ycw8mkp3B9/L4C0pf/fnprvny\
DNWwA2yE="
- PYPKG=yaff
- GITHUB_REPO_NAME=molmod/yaff

Expand All @@ -18,7 +23,7 @@ language: generic
os:
- linux
- osx
osx_image: xcode8.3
osx_image: xcode6.4
dist: trusty
sudo: false

Expand All @@ -28,126 +33,137 @@ branches:
- /^[0-9]+\.[0-9]+(\.[0-9]+)?([ab][0-9]+)?$/

install:
# Get miniconda. Take the right version, so re-installing python is only needed for 3.5.
- if [[ "$MYCONDAPY" == "2.7" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
# Get miniconda. Take the right version, so re-installing python is only needed for 3.5.
- if [[ "$MYCONDAPY" == "2.7" ]]; then
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
URL="https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh";
else
URL="https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh";
fi;
else
wget https://repo.continuum.io/miniconda/Miniconda2-latest-MacOSX-x86_64.sh -O miniconda.sh;
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
URL="https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh";
else
URL="https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh";
fi;
fi;
else
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
fi;
fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r

# Configure conda and get a few essentials
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels tovrstra
- conda update -q conda
# Get the right python version for building. This only does something for 3.5.
# Install extra package needed to make things work. Most things can be listed as
# dependencies on metal.yaml and setup.py, unless setup.py already imports them.
# Install conda tools for packaging and uploading
- conda install python=${MYCONDAPY} numpy cython sphinx conda-build anaconda-client
# Install more recent stuff with pip
- pip install codecov coverage
# Show conda info for debugging
- conda info -a

# No visual backend for matplotlib.
- export MATPLOTLIBRC=$PWD; echo backend:agg > ${MATPLOTLIBRC}/matplotlibrc
wget ${URL} -O miniconda.sh
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r

# Configure conda and get a few essentials
- conda config --set always_yes yes
- conda config --add channels molmod
- conda update -q conda
# Get the right python version for building. This only does something for 3.5.
# Install extra package needed to make things work. Most things can be listed as
# dependencies on metal.yaml and setup.py, unless setup.py already imports them.
# Install conda tools for packaging and uploading
- conda install python=${MYCONDAPY} numpy cython sphinx conda-build anaconda-client
# Install more recent stuff with pip
- pip install codecov coverage
# Show conda info for debugging
- conda info -a

# No visual backend for matplotlib.
- export MATPLOTLIBRC=$PWD; echo backend:agg > ${MATPLOTLIBRC}/matplotlibrc

script:
# Check if code is normalized properly, whitespace etc
- wget https://raw.githubusercontent.com/tovrstra/devscripts/master/scripts/ds-normalize-code -O ds-normalize-code;
chmod +x ds-normalize-code;
./ds-normalize-code;
# Check if code is normalized properly, whitespace etc
- wget https://raw.githubusercontent.com/tovrstra/devscripts/master/scripts/ds-normalize-code -O ds-normalize-code;
chmod +x ds-normalize-code;
./ds-normalize-code;

# Build the conda package
- git fetch origin --tags
- conda build -q tools/conda.recipe
# Build the conda package
- git fetch origin --tags
- conda build -q tools/conda.recipe

# Build source package, should work too and needed for deployment to Github and
# PyPI.
- python setup.py sdist
# Build source package, should work too and needed for deployment to Github and
# PyPI.
- python setup.py sdist

# Install Conda package
- conda install --use-local $PYPKG
# Install Conda package
- conda install --use-local $PYPKG

# Compile documentation
- (cd doc; make html)
# Compile documentation
- (cd doc; make html)

# Run tests out of source tree, to make sure that installed version is tested.
- (cd; nosetests $PYPKG -v --detailed-errors --with-coverage --cover-package=$PYPKG --cover-tests --cover-erase --cover-inclusive --cover-branches --cover-xml)
# Run tests out of source tree, to make sure that installed version is tested.
- (cd; nosetests $PYPKG -v --detailed-errors --with-coverage --cover-package=$PYPKG
--cover-tests --cover-erase --cover-inclusive --cover-branches --cover-xml)

## Run the optimizer test DISABLED UNTIL TAMKIN IS PORTED TO PYTHON 3
#- (cd; yaff-opttest)
## Run the optimizer test DISABLED UNTIL TAMKIN IS PORTED TO PYTHON 3
# - (cd; yaff-opttest)

after_success:
# Upload the coverage analysis
- codecov -f ~/coverage.xml
# Upload the coverage analysis
- codecov -f ~/coverage.xml

# In deployment, the env var TRAVIS_TAG contains the name of the current tag, if any.
deploy:
- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file: dist/${PYPKG}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
prerelease: false
- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file: dist/${PYPKG}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
prerelease: true
- provider: script
skip_cleanup: true
script: anaconda -t $ANACONDA_TOKEN upload -l alpha ${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *a*"
- provider: script
skip_cleanup: true
script: anaconda -t $ANACONDA_TOKEN upload -l beta ${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *b*"
- provider: script
skip_cleanup: true
script: anaconda -t $ANACONDA_TOKEN upload -l main ${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]*"
- provider: pypi
skip_cleanup: true
user: tovrstra
password: ${PYPI_PASSWD}
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
- provider: pages
skip_cleanup: true
github_token: ${GITHUB_TOKEN}
project_name: ${PYPKG}
local_dir: doc/_build/html
on:
repo: ${GITHUB_REPO_NAME}
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
tags: true
- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file: dist/${PYPKG}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
prerelease: false

- provider: releases
skip_cleanup: true
api_key: ${GITHUB_TOKEN}
file: dist/${PYPKG}-${TRAVIS_TAG}.tar.gz
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
prerelease: true

- provider: script
skip_cleanup: true
script: anaconda -t ${ANACONDA_TOKEN} upload --force -l alpha
${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *a*"

- provider: script
skip_cleanup: true
script: anaconda -t ${ANACONDA_TOKEN} upload --force -l beta
${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG == *b*"

- provider: script
skip_cleanup: true
script: anaconda -t ${ANACONDA_TOKEN} upload --force -l main
${HOME}/miniconda/conda-bld/*/${PYPKG}-*.tar.bz2
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]*"

- provider: pypi
skip_cleanup: true
user: molmod
password: ${PYPI_PASSWD}
on:
repo: ${GITHUB_REPO_NAME}
tags: true
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"

- provider: pages
skip_cleanup: true
github_token: ${GITHUB_TOKEN}
project_name: ${PYPKG}
local_dir: doc/_build/html
on:
repo: ${GITHUB_REPO_NAME}
condition: "$TRAVIS_TAG != *[ab]* && $MYCONDAPY == 2.7 && $TRAVIS_OS_NAME == linux"
tags: true
7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
document-start: disable
line-length:
max: 100
truthy: disable
File renamed without changes.
Loading

0 comments on commit 558d7fe

Please sign in to comment.