-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
166 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
sudo: required | ||
|
||
language: generic | ||
|
||
matrix: | ||
|
||
include: | ||
- os: linux | ||
python: 2.7 | ||
env: TRAVIS_PYTHON_VERSION=2.7 | ||
|
||
- os: osx | ||
python: 2.7 | ||
env: TRAVIS_PYTHON_VERSION=2.7 | ||
|
||
before_install: | ||
- | | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p $HOME/miniconda | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
conda install -y conda-build | ||
else | ||
# Install Miniconda | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p $HOME/miniconda | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
conda install -y conda-build | ||
fi | ||
script: | ||
- chmod u+x ci/build_and_test.sh | ||
- ./ci/build_and_test.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env bash | ||
# Make sure we fail in case of errors | ||
set -e | ||
|
||
# FLAGS AND ENVIRONMENT: | ||
LIBGFORTRAN_VERSION="3.0" | ||
READLINE_VERSION="6.2" | ||
UPDATE_CONDA=false | ||
|
||
ENVNAME=xsmodelsonly_test_$TRAVIS_PYTHON_VERSION | ||
|
||
conda_channel=conda-forge/label/cf201901 | ||
|
||
if [[ ${TRAVIS_OS_NAME} == linux ]]; | ||
then | ||
miniconda_os=Linux | ||
else # osx | ||
miniconda_os=MacOSX | ||
fi | ||
|
||
echo "Running on ${TRAVIS_OS_NAME}" | ||
echo "Python version: ${TRAVIS_PYTHON_VERSION}" | ||
|
||
if $UPDATE_CONDA ; then | ||
# Updating conda | ||
echo "======================> Updating conda..." | ||
conda update --yes -q conda conda-build | ||
fi | ||
|
||
if [[ ${TRAVIS_OS_NAME} == osx ]]; | ||
then | ||
conda config --add channels $conda_channel | ||
fi | ||
|
||
# Answer yes to all questions (non-interactive) | ||
conda config --set always_yes true | ||
|
||
# We will upload explicitly at the end, if successful | ||
conda config --set anaconda_upload no | ||
|
||
# Create test environment | ||
echo " ======================> Creating the test environment..." | ||
|
||
conda create --yes --name $ENVNAME -c $conda_channel python=$TRAVIS_PYTHON_VERSION readline=${READLINE_VERSION} | ||
#libgfortran=${LIBGFORTRAN_VERSION} | ||
|
||
# Make sure conda-forge is the first channel | ||
conda config --add channels $conda_channel | ||
|
||
#conda config --add channels defaults | ||
|
||
# Activate test environment | ||
echo "=====================> Activate test environment..." | ||
|
||
source $CONDA_PREFIX/etc/profile.d/conda.sh | ||
conda activate $ENVNAME | ||
|
||
# Build package | ||
echo "Build package..." | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
conda build --python=$TRAVIS_PYTHON_VERSION conda_recipe/xspec-modelsonly | ||
#conda index $HOME/miniconda/conda-bld | ||
else | ||
# there is some strange error about the prefix length | ||
conda build --no-build-id --python=$TRAVIS_PYTHON_VERSION conda_recipe/xspec-modelsonly | ||
#conda index $HOME/miniconda/conda-bld | ||
fi | ||
echo "======> installing..." | ||
conda install --use-local -c $conda_channel xspec-modelsonly | ||
|
||
|
||
# UPLOAD TO CONDA: | ||
# If we are on the master branch upload to the channel | ||
if [[ "${TRAVIS_EVENT_TYPE}" == "pull_request" ]]; then | ||
echo "This is a pull request, not uploading to Conda channel" | ||
else | ||
if [[ "${TRAVIS_EVENT_TYPE}" == "push" ]]; then | ||
echo "This is a push to TRAVIS_BRANCH=${TRAVIS_BRANCH}" | ||
if [[ "${TRAVIS_BRANCH}" == "master" ]]; then | ||
conda install -c conda-forge anaconda-client | ||
echo "Uploading ${CONDA_BUILD_PATH}" | ||
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then | ||
anaconda -t $CONDA_UPLOAD_TOKEN upload -u threeml /home/travis/miniconda/conda-bld/linux-64/*.tar.bz2 --force | ||
else | ||
anaconda -t $CONDA_UPLOAD_TOKEN upload -u threeml /Users/travis/miniconda/conda-bld/*/*.tar.bz2 --force | ||
fi | ||
fi | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters