From 8935fce8d8c39cf90973ec67114d19bf0fec8c0c Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 30 Aug 2020 16:05:40 +0200 Subject: [PATCH 1/2] Remove Travis CI Update badge for Azure --- .travis.yml | 37 -------------- README.md | 2 +- conda_package/travis_ci/install.bash | 24 --------- conda_package/travis_ci/linux_python3.6.yaml | 20 -------- conda_package/travis_ci/linux_python3.7.yaml | 20 -------- conda_package/travis_ci/linux_python3.8.yaml | 20 -------- .../travis_ci/test_and_publish_docs.bash | 51 ------------------- 7 files changed, 1 insertion(+), 173 deletions(-) delete mode 100644 .travis.yml delete mode 100755 conda_package/travis_ci/install.bash delete mode 100644 conda_package/travis_ci/linux_python3.6.yaml delete mode 100644 conda_package/travis_ci/linux_python3.7.yaml delete mode 100644 conda_package/travis_ci/linux_python3.8.yaml delete mode 100755 conda_package/travis_ci/test_and_publish_docs.bash diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e48ddc8fe..000000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Based on https://github.com/NOAA-ORR-ERD/gridded/blob/master/.travis.yml -# and https://github.com/MPAS-Dev/MPAS-Analysis/blob/develop/.travis.yml -language: minimal - -sudo: false - -notifications: - email: false - -matrix: - fast_finish: true - include: - - name: "python3.6" - - name: "python3.7" - - name: "python3.8" - -env: - global: - secure: "UNbdZPiOpDmEdG/S2PVcb0vKj/IwqLIGEPWnUOZ/oXkdjoz6StuZE8iDphuKwLQGhNIee4lkBew/iwSjdQueqxjIQhxA1rvj1kpco5cc445a/ASeAqD1AihCGDXC3EhQ0KJpBEtUOtfiVDlPDy/irVAnWu3DrCw+zExGs15+rUXGZjDU16ZPh+RsLJohdmPjMN/Mk1+c50GIJLMmRu8SFFR6Bh4h/+8yKdqy4lOVc0D+tMAjXBKhPWEF2OpIeLw/s0cVNnCOy30Cyu40vFqzQWDqEeWyteAjmgtIkYOlHTAy2AlF0XNkaNZafEUKf/+laHal597WZc7tfwA8mShAUKG2ZXQRA3GtN6l8TAUc15CF/s7UVSEcaoLvbGXQfHJuIIqweBIdOx/k0Mv1aLX2JgKnJTBPU/Y6wI4Do2gxDR7YH9TTJNCNZkckJPQHOkHKd1qaLtL/ZzvyddZNo2YX8dgfvfEaE/m0OPtNS3/34cSoycqy8EkKe62+z57QyruZmBoi5E/pJrFnS6OvCqEi5Un6JkxyKqCZPNmyie+X9PCELTzPsIM2++PncNuOVXv+pGnZGYB88rNqescPNa8ECaeJpZFVGLIvaELy4CcGvwfV9cemKElCBtpGfwbn0DEJ7o7WQH+xI04P3OV12NLPDyc81XZBSu3jfTYH7dFArNM=" - -before_install: - - | - wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - bash miniconda.sh -b -p $HOME/miniconda - source $HOME/miniconda/etc/profile.d/conda.sh - conda activate base - conda config --set always_yes yes --set changeps1 no --set show_channel_urls true - conda update conda - conda config --add channels conda-forge --force - conda config --set channel_priority strict - conda install conda-build - -install: - - "./conda_package/travis_ci/install.bash" - -script: - - "./conda_package/travis_ci/test_and_publish_docs.bash" diff --git a/README.md b/README.md index baf2966e1..c6c60ff08 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/conda_package/travis_ci/install.bash b/conda_package/travis_ci/install.bash deleted file mode 100755 index 0e0d896e0..000000000 --- a/conda_package/travis_ci/install.bash +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -e - -source $HOME/miniconda/etc/profile.d/conda.sh -conda activate base -conda build -m "conda_package/travis_ci/linux_${TRAVIS_JOB_NAME}.yaml" "conda_package/recipe" - -conda create -y -n test --use-local mpas_tools pytest sphinx mock \ - sphinx_rtd_theme - -conda activate test - -if [[ "$TRAVIS_BRANCH" == "master" ]]; then - export DOCS_VERSION="stable" -elif [ -n "$TRAVIS_TAG" ]; then - # this is a tag build - export DOCS_VERSION="$TRAVIS_TAG" -else - DOCS_VERSION=`python -c "import mpas_tools; print(mpas_tools.__version__)"` - export DOCS_VERSION -fi -cd conda_package/docs || exit 1 -make html diff --git a/conda_package/travis_ci/linux_python3.6.yaml b/conda_package/travis_ci/linux_python3.6.yaml deleted file mode 100644 index edd953b25..000000000 --- a/conda_package/travis_ci/linux_python3.6.yaml +++ /dev/null @@ -1,20 +0,0 @@ -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: -- 4.7.4 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- '3.6' diff --git a/conda_package/travis_ci/linux_python3.7.yaml b/conda_package/travis_ci/linux_python3.7.yaml deleted file mode 100644 index d2b0b62e6..000000000 --- a/conda_package/travis_ci/linux_python3.7.yaml +++ /dev/null @@ -1,20 +0,0 @@ -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: -- 4.7.4 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- '3.7' diff --git a/conda_package/travis_ci/linux_python3.8.yaml b/conda_package/travis_ci/linux_python3.8.yaml deleted file mode 100644 index 355bdabcd..000000000 --- a/conda_package/travis_ci/linux_python3.8.yaml +++ /dev/null @@ -1,20 +0,0 @@ -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: -- 4.7.4 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- '3.8' diff --git a/conda_package/travis_ci/test_and_publish_docs.bash b/conda_package/travis_ci/test_and_publish_docs.bash deleted file mode 100755 index d2a0a24a7..000000000 --- a/conda_package/travis_ci/test_and_publish_docs.bash +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# based on https://stackoverflow.com/a/49516361/7728169 - -set -e - -source $HOME/miniconda/etc/profile.d/conda.sh -conda activate test - -pytest --pyargs mpas_tools - -if [[ "${TRAVIS_JOB_NAME}" != "python3.7" ]]; then - # we only deploy with the python 3.7 build - exit 0 -fi - -if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then - export DOCS_VERSION="stable" -elif [ -n "$TRAVIS_TAG" ]; then - # this is a tag build - export DOCS_VERSION="$TRAVIS_TAG" -else - # nothing to deploy - exit 0 -fi - -echo "Docs version: $DOCS_VERSION" - -PUBLICATION_BRANCH=gh-pages -# Checkout the branch -REPO_PATH=$PWD -pushd $HOME || exit 1 -git clone --branch=$PUBLICATION_BRANCH https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG 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"/conda_package/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 user.name "Travis" - git config user.email "travis@travis-ci.org" - git commit -m "Updated $DOCS_VERSION" - git push -fq origin $PUBLICATION_BRANCH -fi -popd || exit 1 From d3a67f4c529669c80fe586be961b7238acc57f86 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Sun, 30 Aug 2020 16:16:54 +0200 Subject: [PATCH 2/2] Add Azure Pipelines --- azure-pipelines.yml | 153 ++++++++++++++++++++++++++ conda_package/ci/linux_python3.6.yaml | 16 +++ conda_package/ci/linux_python3.7.yaml | 16 +++ conda_package/ci/linux_python3.8.yaml | 14 +++ conda_package/ci/osx_python3.6.yaml | 16 +++ conda_package/ci/osx_python3.7.yaml | 16 +++ conda_package/ci/osx_python3.8.yaml | 16 +++ 7 files changed, 247 insertions(+) create mode 100644 azure-pipelines.yml create mode 100644 conda_package/ci/linux_python3.6.yaml create mode 100644 conda_package/ci/linux_python3.7.yaml create mode 100644 conda_package/ci/linux_python3.8.yaml create mode 100644 conda_package/ci/osx_python3.6.yaml create mode 100644 conda_package/ci/osx_python3.7.yaml create mode 100644 conda_package/ci/osx_python3.8.yaml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..daa449fe6 --- /dev/null +++ b/azure-pipelines.yml @@ -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 + diff --git a/conda_package/ci/linux_python3.6.yaml b/conda_package/ci/linux_python3.6.yaml new file mode 100644 index 000000000..419b573a1 --- /dev/null +++ b/conda_package/ci/linux_python3.6.yaml @@ -0,0 +1,16 @@ +channel_sources: +- conda-forge,defaults +cxx_compiler: +- gxx +cxx_compiler_version: +- '7' +hdf5: +- 1.10.6 +libnetcdf: +- 4.7.4 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.6.* *_cpython diff --git a/conda_package/ci/linux_python3.7.yaml b/conda_package/ci/linux_python3.7.yaml new file mode 100644 index 000000000..83b6b0676 --- /dev/null +++ b/conda_package/ci/linux_python3.7.yaml @@ -0,0 +1,16 @@ +channel_sources: +- conda-forge,defaults +cxx_compiler: +- gxx +cxx_compiler_version: +- '7' +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 diff --git a/conda_package/ci/linux_python3.8.yaml b/conda_package/ci/linux_python3.8.yaml new file mode 100644 index 000000000..fb56a247c --- /dev/null +++ b/conda_package/ci/linux_python3.8.yaml @@ -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 diff --git a/conda_package/ci/osx_python3.6.yaml b/conda_package/ci/osx_python3.6.yaml new file mode 100644 index 000000000..e3c7cb7c7 --- /dev/null +++ b/conda_package/ci/osx_python3.6.yaml @@ -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.6.* *_cpython diff --git a/conda_package/ci/osx_python3.7.yaml b/conda_package/ci/osx_python3.7.yaml new file mode 100644 index 000000000..ec7255319 --- /dev/null +++ b/conda_package/ci/osx_python3.7.yaml @@ -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 diff --git a/conda_package/ci/osx_python3.8.yaml b/conda_package/ci/osx_python3.8.yaml new file mode 100644 index 000000000..0d012cf19 --- /dev/null +++ b/conda_package/ci/osx_python3.8.yaml @@ -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