diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index baf3725..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,192 +0,0 @@ -trigger: - branches: - include: - - main - tags: - include: - - '*' - -pr: - branches: - include: - - main - -jobs: -- job: - displayName: linux - pool: - vmImage: 'ubuntu-latest' - strategy: - matrix: - Python39: - python.version: '3.9' - Python310: - python.version: '3.10' - Python311: - python.version: '3.11' - - steps: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add conda to PATH - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda config --add channels conda-forge - conda config --set channel_priority strict - conda update --yes --all - conda install --yes mamba - # workaround based on recent failures - rm /usr/share/miniconda/pkgs/cache/*.json - mamba install --yes conda-build boa - displayName: Update conda base environment - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate - # workaround based on recent failures - rm /usr/share/miniconda/pkgs/cache/*.json - conda mambabuild -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe" - displayName: Build pyremap - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate - mamba create --yes --quiet --name test -c ${CONDA_PREFIX}/conda-bld/ \ - python=$PYTHON_VERSION pyremap "esmf=*=mpi_mpich_*" pytest - displayName: Create Anaconda pyremap environment - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate test - pytest --pyargs pyremap - displayName: pytest - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate - conda create --yes --quiet --name docs -c ${CONDA_PREFIX}/conda-bld/ \ - python=$PYTHON_VERSION pyremap sphinx mock sphinx_rtd_theme m2r2 \ - "mistune<2" - condition: eq(variables['python.version'], '3.10') - displayName: Create Anaconda docs environment - - - bash: | - set -e - 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 pyremap; print(pyremap.__version__)"` - echo "version: $version" - - REPO_PATH=$PWD - - if [[ "$(Build.SourceBranch)" == "refs/heads/main" ]]; 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 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.10') - displayName: build and deploy docs - -- job: - displayName: osx - pool: - vmImage: 'macOS-latest' - strategy: - matrix: - Python39: - python.version: '3.9' - Python310: - python.version: '3.10' - Python311: - python.version: '3.11' - - steps: - - bash: echo "##vso[task.prependpath]$CONDA/bin" - displayName: Add conda to PATH - - - bash: sudo chown -R 501:20 /usr/local/miniconda/pkgs - displayName: Fix permissions - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda config --add channels conda-forge - conda config --set channel_priority strict - conda update --yes --all - conda install --yes mamba - mamba install --yes conda-build boa - displayName: Update conda base environment - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate - conda mambabuild -m "ci/python${PYTHON_VERSION}.yaml" "ci/recipe" - displayName: Build pyremap - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate - mamba create --yes --quiet --name test -c ${CONDA_PREFIX}/conda-bld/ \ - python=$PYTHON_VERSION pyremap "esmf=*=mpi_mpich_*" pytest - displayName: Create Anaconda pyremap environment - - - bash: | - set -e - eval "$(conda shell.bash hook)" - conda activate test - pytest --pyargs pyremap - displayName: pytest