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

Add Azure support #338

Merged
merged 2 commits into from
Aug 30, 2020
Merged
Show file tree
Hide file tree
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
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MPAS Tools

[![Build Status](https://travis-ci.org/MPAS-Dev/MPAS-Tools.svg?branch=master)](https://travis-ci.org/MPAS-Dev/MPAS-Tools)
[![Build Status](https://dev.azure.com/MPAS-Dev/MPAS-Tools%20testing/_apis/build/status/MPAS-Dev.MPAS-Tools?branchName=temp)](https://dev.azure.com/MPAS-Dev/MPAS-Tools%20testing/_build/latest?definitionId=4&branchName=temp)

This repository houses all MPAS related tools. These include compiled tools,
and scripts with a variety of purposes. Tools should be sorted into larger
Expand Down
153 changes: 153 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
jobs:
- job:
displayName: linux
pool:
vmImage: 'ubuntu-16.04'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- bash: |
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --yes --quiet --name build python=$PYTHON_VERSION conda conda-build
displayName: Create Anaconda build environment

- bash: |
eval "$(conda shell.bash hook)"
conda activate build
conda build -m "conda_package/ci/linux_python${PYTHON_VERSION}.yaml" "conda_package/recipe"
displayName: Build MPAS-Tools

- bash: |
eval "$(conda shell.bash hook)"
conda create --yes --quiet --name test --use-local python=$PYTHON_VERSION \
mpas_tools pytest
displayName: Create Anaconda test environment

- bash: |
eval "$(conda shell.bash hook)"
conda activate test
pytest --pyargs mpas_tools
displayName: pytest

- bash: |
eval "$(conda shell.bash hook)"
conda create --yes --quiet --name docs --use-local python=$PYTHON_VERSION \
mpas_tools sphinx mock sphinx_rtd_theme m2r
condition: eq(variables['python.version'], '3.8')
displayName: Create Anaconda docs environment

- bash: |
eval "$(conda shell.bash hook)"
conda activate docs

echo "source branch: $(Build.SourceBranch)"
echo "target branch: $(System.PullRequest.TargetBranch)"
echo "repository: $(Build.Repository.Name)"

tag=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "tag: $tag"

version=`python -c "import mpas_tools; print(mpas_tools.__version__)"`
echo "version: $version"

REPO_PATH=$PWD

if [[ "$(Build.SourceBranch)" == "refs/heads/master" ]]; then
export DOCS_VERSION="stable"
deploy=True
elif [[ "$(Build.SourceBranch)" == refs/tags/* ]]; then
# this is a tag build
export DOCS_VERSION="$tag"
deploy=True
else
DOCS_VERSION="$version"
export DOCS_VERSION
deploy=False
fi
echo "Docs version: $DOCS_VERSION"
echo "Deploy to gh-pages? $deploy"
cd conda_package/docs || exit 1
make html

cd "$REPO_PATH" || exit 1

if [[ "$deploy" == "True" ]]; then
PUBLICATION_BRANCH=gh-pages
# Checkout the branch
pushd $HOME || exit 1
git clone --branch=$PUBLICATION_BRANCH https://$(GitHubToken)@github.com/$(Build.Repository.Name) publish
cd publish || exit 1

# Update pages
if [[ -d "$DOCS_VERSION" ]]; then
git rm -rf "$DOCS_VERSION" > /dev/null
fi
mkdir "$DOCS_VERSION"
cp -r "$REPO_PATH"/docs/_build/html/* "$DOCS_VERSION"
# Commit and push latest version
git add .
if git diff-index --quiet HEAD; then
echo "No changes in the docs."
else
git config --local user.name "Azure Pipelines"
git config --local user.email "azuredevops@microsoft.com"
git commit -m "[skip ci] Update $DOCS_VERSION"
git push -fq origin $PUBLICATION_BRANCH
fi
popd || exit 1
fi
condition: eq(variables['python.version'], '3.8')
displayName: build and deploy docs

- job:
displayName: osx
pool:
vmImage: 'macOS-10.14'
strategy:
matrix:
Python36:
python.version: '3.6'
Python37:
python.version: '3.7'
Python38:
python.version: '3.8'

steps:
- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH

- bash: |
conda config --add channels conda-forge
conda config --set channel_priority strict
conda create --yes --quiet --name build python=$PYTHON_VERSION conda conda-build
displayName: Create Anaconda build environment

- bash: |
eval "$(conda shell.bash hook)"
conda activate build
conda build -m "conda_package/ci/osx_python${PYTHON_VERSION}.yaml" "conda_package/recipe"
displayName: Build MPAS-Tools

- bash: |
eval "$(conda shell.bash hook)"
conda create --yes --quiet --name test --use-local python=$PYTHON_VERSION \
mpas_tools pytest
displayName: Create Anaconda test environment

- bash: |
eval "$(conda shell.bash hook)"
conda activate test
pytest --pyargs mpas_tools
displayName: pytest

Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
cxx_compiler:
- gxx
cxx_compiler_version:
- '7'
docker_image:
- condaforge/linux-anvil-comp7
hdf5:
- 1.10.6
libnetcdf:
Expand All @@ -17,4 +13,4 @@ pin_run_as_build:
min_pin: x.x
max_pin: x.x
python:
- '3.6'
- 3.6.* *_cpython
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
cxx_compiler:
- gxx
cxx_compiler_version:
- '7'
docker_image:
- condaforge/linux-anvil-comp7
hdf5:
- 1.10.6
libnetcdf:
Expand All @@ -17,4 +13,4 @@ pin_run_as_build:
min_pin: x.x
max_pin: x.x
python:
- '3.7'
- 3.7.* *_cpython
14 changes: 14 additions & 0 deletions conda_package/ci/linux_python3.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
channel_sources:
- conda-forge,defaults
cxx_compiler:
- gxx
cxx_compiler_version:
- '7'
hdf5:
- 1.10.6
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.8.* *_cpython
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
channel_sources:
- conda-forge,defaults
channel_targets:
- conda-forge main
cxx_compiler:
- gxx
- clangxx
cxx_compiler_version:
- '7'
docker_image:
- condaforge/linux-anvil-comp7
- '10'
hdf5:
- 1.10.6
libnetcdf:
Expand All @@ -17,4 +13,4 @@ pin_run_as_build:
min_pin: x.x
max_pin: x.x
python:
- '3.8'
- 3.6.* *_cpython
16 changes: 16 additions & 0 deletions conda_package/ci/osx_python3.7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
channel_sources:
- conda-forge,defaults
cxx_compiler:
- clangxx
cxx_compiler_version:
- '10'
hdf5:
- 1.10.6
libnetcdf:
- 4.7.4
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.7.* *_cpython
16 changes: 16 additions & 0 deletions conda_package/ci/osx_python3.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
channel_sources:
- conda-forge,defaults
cxx_compiler:
- clangxx
cxx_compiler_version:
- '10'
hdf5:
- 1.10.6
libnetcdf:
- 4.7.4
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.8.* *_cpython
24 changes: 0 additions & 24 deletions conda_package/travis_ci/install.bash

This file was deleted.

51 changes: 0 additions & 51 deletions conda_package/travis_ci/test_and_publish_docs.bash

This file was deleted.