Skip to content

Commit

Permalink
Expand Azure pipeline (#48)
Browse files Browse the repository at this point in the history
* Add azure-pipelines.yml

* Make names valid

* Force creation of directories

* Explicitly make directory

* Move CmdStan directory to temp dir

* Separate installation into template files

* Further indent

* Separate test and docs into different jobs

[skip travis]

* Un-indent displayName

[skip travis]

* Divide into stages, add master

[skip travis]

* Use max time limit for docs

[skip travis]

* Change variable name

[skip travis]

* Move templates to directory

[skip travis]

* Refactor into template files

[skip travis]

* Remove old stages

[skip travis]

* Make internal template paths relative

[skip travis]

* Use replacement syntax

[skip travis]

* Define ARVIZ_VERSION each job

[skip travis]

* Revert "Define ARVIZ_VERSION each job"

This reverts commit 09c5a59.

* Expand template parameter in quotes

[skip travis]

* Use relative path for Julia

[skip travis]

* Test inverse of tag condition

[skip travis]

* Temporarily don't condition docs

[skip travis]

* Upload code coverage after tests

[skip travis]

* Reverse tag condition

[skip travis]

* Add missing colon

[skip travis]

* Remove comment

* Set expected env variables for Documenter

[skip travis]

* Remove duplicate dollar sign

[skip travis]

* Remove parens

[skip travis]

* Export secret keys

[skip travis]

* Try converting variables to strings

[skip travis]

* Move docs build to template file

[skip travis]

* Revert "Try converting variables to strings"

This reverts commit 883c313.

* Try other string syntax

[skip travis]

* Revert "Try other string syntax"

This reverts commit d4ff104.

* Remove unnecessary echos

* Move ArviZ#master installation to main

The order of template expansion and variable evaluation tends to cause the template approach to fail. [skip travis]

* Use index syntax

* Stop building docs with Travis, allow future failures

* Revert "Temporarily don't condition docs"

This reverts commit b41bc32.

* Add Azure badges

* Add dev suffix to version until ready for release

* Explicitly continue on error for future tests

* Cache cmdstan

[skip travis]

* Wrap variable in parens

[skip travis]

* Try switching from parameter to outer var

[skip travis]

* Rely on outer variables everywhere

[skip travis]

* Fix variable name

[skip travis]
  • Loading branch information
sethaxen committed Feb 15, 2020
1 parent 5006170 commit d65455c
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 26 deletions.
18 changes: 18 additions & 0 deletions .azure_templates/build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
- bash: |
set -o xtrace
export TRAVIS_REPO_SLUG="$BUILD_REPOSITORY_NAME"
if [[ $BUILD_SOURCEBRANCH == refs/tags/* ]]; then
export TRAVIS_TAG="${BUILD_SOURCEBRANCH:10}"
elif [[ $BUILD_SOURCEBRANCH == refs/heads/* ]]; then
export TRAVIS_BRANCH="${BUILD_SOURCEBRANCH:11}"
elif [[ $BUILD_SOURCEBRANCH == refs/pull/* ]]; then
export TRAVIS_PULL_REQUEST="$(cut -d'/' -f3 <<< $BUILD_SOURCEBRANCH)"
fi
export DOCUMENTER_KEY="$(DOCUMENTER_KEY)"
./julia -e 'using InteractiveUtils; versioninfo()'
./julia --project=docs/ -e 'using Pkg; Pkg.instantiate();
Pkg.develop(PackageSpec(path=pwd()));
Pkg.build()'
./julia --color=yes --project=docs/ docs/make.jl
displayName: 'Build and deploy the docs'
13 changes: 13 additions & 0 deletions .azure_templates/install_arvizmaster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
steps:
- bash: |
set -o xtrace
./julia -e 'using Pkg;
Pkg.add("PyCall");
using PyCall;
run(PyCall.python_cmd(`-m pip install git+https://github.com/pydata/xarray git+https://github.com/arviz-devs/arviz`))';
displayName: 'Install arviz#master'
condition: |
and(
eq(variables['ARVIZ_VERSION'], 'master'),
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
)
14 changes: 14 additions & 0 deletions .azure_templates/install_cmdstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
steps:
- task: Cache@2
inputs:
key: cmdstan | "$(CMDSTAN_VERSION)" | "$(Agent.OS)"
restoreKeys: cmdstan | "$(CMDSTAN_VERSION)" | "$(Agent.OS)"
path: "$(CMDSTAN_DIR)"
cacheHitVar: CMDSTAN_CACHE_RESTORED
- bash: |
set -o xtrace
wget -P $(CMDSTAN_DIR) https://github.com/stan-dev/cmdstan/releases/download/v$(CMDSTAN_VERSION)/cmdstan-$(CMDSTAN_VERSION).tar.gz
tar -xzpf $(CMDSTAN_DIR)/cmdstan-$(CMDSTAN_VERSION).tar.gz -C $(CMDSTAN_DIR)
make -C $(CMDSTAN_DIR)/cmdstan-$(CMDSTAN_VERSION)/ build
displayName: 'Download and build CmdStan'
condition: ne(variables.CMDSTAN_CACHE_RESTORED, 'true')
4 changes: 4 additions & 0 deletions .azure_templates/install_dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
steps:
- template: install_cmdstan.yml
- template: install_julia.yml
- template: install_arvizmaster.yml
16 changes: 16 additions & 0 deletions .azure_templates/install_julia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
steps:
- bash: |
set -o xtrace
if [[ $(JULIA_VERSION) == nightly ]]
then
wget -nv https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz
mkdir julia-$(JULIA_VERSION)
tar zxf julia-latest-linux64.tar.gz -C julia-$(JULIA_VERSION) --strip-components 1
else
wget -nv https://julialang-s3.julialang.org/bin/linux/x64/$(JULIA_VERSION)/julia-$(JULIA_VERSION)-latest-linux-x86_64.tar.gz
mkdir julia-$(JULIA_VERSION)
tar zxf julia-$(JULIA_VERSION)-latest-linux-x86_64.tar.gz -C julia-$(JULIA_VERSION) --strip-components 1
fi
ln -s ./julia-$(JULIA_VERSION)/bin/julia ./julia
./julia --color=yes -e "VERSION >= v\"0.7.0-DEV.3630\" && using InteractiveUtils; versioninfo()"
displayName: 'Download and extract Julia'
28 changes: 28 additions & 0 deletions .azure_templates/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
parameters:
- name: allow_failures
type: boolean
default: false

steps:
- bash: |
set -o xtrace
./julia -e 'using InteractiveUtils; versioninfo()'
./julia --project=@. -e 'using Pkg; Pkg.instantiate()'
./julia --project=@. -e 'using Pkg; Pkg.test(coverage=true)'
displayName: 'Run the tests'
continueOnError: ${{ parameters.allow_failures }}
- bash: |
set -o xtrace
export CODECOV_TOKEN="$(CODECOV_TOKEN)"
./julia --project=.coverage -e 'using Pkg; Pkg.instantiate();
Pkg.add("Coverage");
using Coverage;
Codecov.submit_local(Codecov.process_folder();
service = "azure_pipelines",
commit = ENV["BUILD_SOURCEVERSION"],
pull_request = get(ENV, "SYSTEM_PULLREQUEST_PULLREQUESTNUMBER", "false"),
job = ENV["BUILD_DEFINITIONNAME"],
slug = ENV["BUILD_REPOSITORY_NAME"],
build = ENV["BUILD_BUILDID"])'
displayName: 'Submit code coverage'
continueOnError: true
39 changes: 22 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,39 @@ cache:
- $CMDSTAN_CACHE
jobs:
allow_failures:
- julia: 1.3
env: ARVIZ_VERSION=master
- julia: 1.4
- julia: nightly
include:
- stage: test
- stage: Test
julia: 1.1
- stage: test
- stage: Test
julia: 1.3
- stage: test
- stage: Test
julia: 1.3
env: ARVIZ_MASTER=true
- stage: test
env: ARVIZ_VERSION=master
- stage: Test
julia: 1.4
- stage: test
- stage: Test
julia: nightly
- stage: Documentation
julia: 1.3
env: ARVIZ_MASTER=true
script:
- julia --color=yes --project=docs/ docs/make.jl
after_success: skip
# - stage: Documentation
# julia: 1.3
# env: ARVIZ_MASTER=true
# script:
# - julia --color=yes --project=docs/ docs/make.jl
# after_success: skip
before_install:
- if [ ! -d $JULIA_CMDSTAN_HOME ]; then
wget -P $CMDSTAN_CACHE https://github.com/stan-dev/cmdstan/releases/download/v$CMDSTAN_VERSION/cmdstan-$CMDSTAN_VERSION.tar.gz;
tar -xzpf $CMDSTAN_CACHE/cmdstan-$CMDSTAN_VERSION.tar.gz -C $CMDSTAN_CACHE;
make -C $JULIA_CMDSTAN_HOME build;
wget -P $CMDSTAN_CACHE https://github.com/stan-dev/cmdstan/releases/download/v$CMDSTAN_VERSION/cmdstan-$CMDSTAN_VERSION.tar.gz;
tar -xzpf $CMDSTAN_CACHE/cmdstan-$CMDSTAN_VERSION.tar.gz -C $CMDSTAN_CACHE;
make -C $JULIA_CMDSTAN_HOME build;
fi
- if [[ ( "$ARVIZ_MASTER" = true ) && ( ! -n "$TRAVIS_TAG" ) ]]; then
julia -e 'using Pkg; Pkg.add("PyCall"); using PyCall; run(PyCall.python_cmd(`-m pip install git+https://github.com/pydata/xarray git+https://github.com/arviz-devs/arviz`))';
- if [[ ( "$ARVIZ_VERSION" = 'master' ) && ( ! -n "$TRAVIS_TAG" ) ]]; then
julia -e 'using Pkg;
Pkg.add("PyCall");
using PyCall;
run(PyCall.python_cmd(`-m pip install git+https://github.com/pydata/xarray git+https://github.com/arviz-devs/arviz`))';
fi
after_success:
- julia --project=test/coverage -e 'using Pkg; Pkg.instantiate()'
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ArviZ"
uuid = "131c737c-5715-5e2e-ad31-c244f01c1dc7"
authors = ["Seth Axen <seth.axen@gmail.com>"]
version = "0.2.5"
version = "0.2.5-DEV"

[deps]
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Build Status](https://travis-ci.com/arviz-devs/ArviZ.jl.svg?branch=master)](https://travis-ci.com/arviz-devs/ArviZ.jl)
[![Build Status](https://dev.azure.com/ArviZ/ArviZ/_apis/build/status/arviz-devs.ArviZ.jl?branchName=master)](https://dev.azure.com/ArviZ/ArviZ/_build/latest?definitionId=2&branchName=master)
[![codecov.io](https://codecov.io/github/arviz-devs/ArviZ.jl/coverage.svg?branch=master)](https://codecov.io/github/arviz-devs/ArviZ.jl?branch=master)
[![Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://arviz-devs.github.io/ArviZ.jl/stable)
[![Documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://arviz-devs.github.io/ArviZ.jl/dev)
Expand Down
53 changes: 45 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,52 @@

trigger:
- master
- releases/*

variables:
PYTHON: "Conda" # use Julia's packaged Conda build for installing packages
CMDSTAN_VERSION: "2.21.0"
CMDSTAN_DIR: "$(Agent.TempDirectory)/.cmdstan/"
JULIA_CMDSTAN_HOME: "$(CMDSTAN_DIR)/cmdstan-$(CMDSTAN_VERSION)/" # required by CmdStan.jl
ARVIZ_VERSION: release

pool:
vmImage: 'ubuntu-latest'

steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'

- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
jobs:
- job: Test_Releases # test released versions of ArviZ and Julia
strategy:
matrix:
Julia_1_0:
JULIA_VERSION: "1.0"
Julia_1_2:
JULIA_VERSION: "1.2"
Julia_1_3:
JULIA_VERSION: "1.3"
steps:
- template: .azure_templates/install_dependencies.yml
- template: .azure_templates/run_tests.yml
- job: Test_Futures # test future versions of ArviZ and Julia
strategy:
matrix:
Julia_1_3_ArviZ_master:
JULIA_VERSION: "1.3"
ARVIZ_VERSION: master
Julia_1_4:
JULIA_VERSION: "1.4"
Julia_nightly:
JULIA_VERSION: "nightly"
steps:
- template: .azure_templates/install_dependencies.yml
- template: .azure_templates/run_tests.yml
parameters:
allow_failures: true
- job: Documentation # build and deploy documentation if tests passed
dependsOn: Test_Releases
timeoutInMinutes: 0
variables:
JULIA_VERSION: "1.3"
ARVIZ_VERSION: master
steps:
- template: .azure_templates/install_dependencies.yml
- template: .azure_templates/build_docs.yml
1 change: 1 addition & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# [ArviZ.jl: Exploratory analysis of Bayesian models in Julia](@id arvizjl)

[![Build Status](https://travis-ci.com/arviz-devs/ArviZ.jl.svg?branch=master)](https://travis-ci.com/arviz-devs/ArviZ.jl)
[![Build Status](https://dev.azure.com/ArviZ/ArviZ/_apis/build/status/arviz-devs.ArviZ.jl?branchName=master)](https://dev.azure.com/ArviZ/ArviZ/_build/latest?definitionId=2&branchName=master)
[![codecov.io](https://codecov.io/github/arviz-devs/ArviZ.jl/coverage.svg?branch=master)](https://codecov.io/github/arviz-devs/ArviZ.jl?branch=master)

ArviZ.jl is a Julia interface to the [ArviZ](https://arviz-devs.github.io/arviz/) package for exploratory analysis of Bayesian models.
Expand Down

0 comments on commit d65455c

Please sign in to comment.