wasmer/azure-pipelines.yml

341 lines
12 KiB
YAML
Raw Permalink Normal View History

2019-08-10 18:11:54 +00:00
name: $(Build.SourceBranch)-$(date:yyyyMMdd)$(rev:.r)
# The Different jobs (lint, test, build to run)
jobs:
2019-09-01 06:15:48 +00:00
- job: changelog
steps:
- bash: |
git --no-pager diff --name-only HEAD $(git merge-base HEAD master) --exit-code CHANGELOG.md
displayName: Changelog Updated
- job: lint
pool:
vmImage: "macos-10.14"
steps:
- checkout: self
- template: .azure/install-rust.yml
- script: |
rustup component add rustfmt
displayName: Lint dependencies
- script: cargo fmt --all -- --check
displayName: Lint
variables:
2020-03-13 23:30:50 +00:00
rust_toolchain: '1.41.1'
2019-08-10 18:11:54 +00:00
- job: clippy_lint
pool:
2020-02-24 19:05:09 +00:00
vmImage: "ubuntu-16.04"
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- script: |
rustup component add rustfmt
rustup component add clippy || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
displayName: Lint dependencies with clippy
- script: cargo clippy --workspace
displayName: Clippy Lint
variables:
rust_toolchain: nightly-2019-12-19
- job: Test
strategy:
matrix:
linux:
2020-03-30 21:45:04 +00:00
poolName: "Azure Pipelines"
2020-02-24 19:05:09 +00:00
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
android:
2020-03-30 22:10:31 +00:00
poolName: "Azure Pipelines"
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
ANDROID: true
mac:
2020-03-30 21:45:04 +00:00
poolName: "Azure Pipelines"
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
2019-09-01 17:20:37 +00:00
# By default schannel checks revocation of certificates unlike some other SSL
# backends, but we've historically had problems on CI where a revocation
# server goes down presumably. See #43333 for more info
CARGO_HTTP_CHECK_REVOKE: false
2020-03-30 21:45:04 +00:00
arm:
poolName: "Packet"
rust_toolchain: nightly-2019-12-19
windows:
2020-03-30 21:45:04 +00:00
poolName: "Azure Pipelines"
imageName: "vs2017-win2016"
2020-03-13 23:30:50 +00:00
rust_toolchain: '1.41.1'
pool:
2020-03-30 21:45:04 +00:00
name: $(poolName)
vmImage: $(imageName)
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
- template: .azure/install-rust.yml
2019-09-01 17:20:37 +00:00
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
2019-09-16 19:14:09 +00:00
- bash: |
hostname
uname -a
displayName: System info (*nix)
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
- bash: |
cat /proc/cpuinfo
cat /proc/meminfo
displayName: System info - Extended (Linux)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
2019-10-15 18:08:10 +00:00
sysctl -a | grep machdep.cpu
displayName: System info - Extended (Mac)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
- bash: make test
displayName: Tests (*nix)
2020-04-16 20:26:24 +00:00
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')), not(variables['ANDROID']))
- bash: make test-android
displayName: Tests (Android)
condition: and(succeeded(), variables['ANDROID'])
2020-04-16 20:26:24 +00:00
- bash: make spectests
displayName: Tests (Windows)
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), not(variables['ANDROID']))
2019-08-10 18:11:54 +00:00
- job: Check
pool:
2020-02-24 19:05:09 +00:00
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
2019-09-03 21:56:29 +00:00
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
- template: .azure/install-rust.yml
2019-09-01 17:20:37 +00:00
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
make check
make check-nightly
displayName: Check with Flags
condition: and(succeeded(), not(eq(variables['Agent.OS'], 'Windows_NT')))
2019-08-10 18:11:54 +00:00
2019-09-01 04:30:20 +00:00
- job: Build_CLI
strategy:
matrix:
linux:
2020-03-30 21:45:04 +00:00
poolName: "Azure Pipelines"
2020-02-24 19:05:09 +00:00
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
2020-03-30 21:45:04 +00:00
poolName: "Azure Pipelines"
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
MACOSX_DEPLOYMENT_TARGET: 10.10
2020-03-30 21:45:04 +00:00
arm:
poolName: "Packet"
rust_toolchain: nightly-2019-12-19
windows:
2020-03-30 21:45:04 +00:00
poolName: "Azure Pipelines"
imageName: "vs2017-win2016"
2020-03-13 23:30:50 +00:00
rust_toolchain: '1.41.1'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
2020-03-30 22:03:50 +00:00
name: $(poolName)
vmImage: $(imageName)
2019-11-23 02:59:40 +00:00
condition: |
or(
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying'),
startsWith(variables['Build.SourceBranch'], 'refs/tags')
)
steps:
- checkout: self
- template: .azure/install-rust.yml
2019-09-01 17:20:37 +00:00
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- template: .azure/install-innosetup.yml
- bash: |
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: make release
displayName: Build
2020-01-28 17:18:25 +00:00
- bash: sudo apt-get install musl-tools && make release-musl
displayName: Build (Linux Musl)
2020-03-30 21:18:36 +00:00
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['Agent.OSArchitecture'], 'X64'))
- bash: |
2020-02-28 19:11:31 +00:00
make build-wapm
displayName: Build WAPM
2019-09-01 07:53:41 +00:00
condition: |
2019-11-23 02:59:40 +00:00
startsWith(variables['Build.SourceBranch'], 'refs/tags')
- bash: |
2020-02-20 19:59:44 +00:00
make build-install-package
cp ./wasmer.tar.gz ./artifacts/$(./scripts/binary-name.sh)
displayName: Build Distribution (*nix)
2019-09-01 07:53:41 +00:00
condition: |
and(
succeeded(),
2019-11-23 02:59:40 +00:00
startsWith(variables['Build.SourceBranch'], 'refs/tags'),
2019-09-01 07:53:41 +00:00
not(eq(variables['Agent.OS'], 'Windows_NT'))
)
- bash: |
cd ./src/installer
iscc wasmer.iss
cp WasmerInstaller.exe ../../artifacts/wasmer-windows.exe
displayName: Build Distribution (Windows)
2019-09-01 07:53:41 +00:00
condition: |
and(
succeeded(),
2019-11-23 02:59:40 +00:00
startsWith(variables['Build.SourceBranch'], 'refs/tags'),
2019-09-01 07:53:41 +00:00
eq(variables['Agent.OS'], 'Windows_NT')
)
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: cli-$(Agent.OS)-$(Agent.OSArchitecture)
2019-08-10 18:11:54 +00:00
2019-09-01 04:30:20 +00:00
- job: Build_Library
strategy:
matrix:
linux:
2020-02-24 19:05:09 +00:00
imageName: "ubuntu-16.04"
rust_toolchain: nightly-2019-12-19
mac:
imageName: "macos-10.14"
rust_toolchain: nightly-2019-12-19
MACOSX_DEPLOYMENT_TARGET: 10.10
windows:
imageName: "vs2017-win2016"
2020-03-13 23:30:50 +00:00
rust_toolchain: '1.41.1'
# RUSTFLAGS: -Ctarget-feature=+crt-static
pool:
vmImage: $(imageName)
2019-11-23 02:59:40 +00:00
condition: |
or(
in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying'),
startsWith(variables['Build.SourceBranch'], 'refs/tags')
)
steps:
- checkout: self
- template: .azure/install-rust.yml
2019-12-13 19:52:59 +00:00
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
mkdir -p artifacts
displayName: Create Artifacts Dir
- bash: |
2019-09-01 16:42:07 +00:00
make test-capi
2019-12-13 00:38:58 +00:00
displayName: Test c-api
2020-03-30 21:18:36 +00:00
condition: and(succeeded(), eq(variables['Agent.OSArchitecture'], 'X64'), not(eq(variables['Agent.OS'], 'Windows_NT')))
2019-12-13 00:38:58 +00:00
- bash: |
make capi
2020-02-20 02:54:32 +00:00
displayName: Build c-api
- bash: |
2020-02-20 19:59:44 +00:00
make build-capi-package
2020-02-20 02:54:32 +00:00
cp ./wasmer-c-api.tar.gz ./artifacts/$(./scripts/capi-name.sh)
2020-02-20 07:14:10 +00:00
displayName: Build c-api artifacts (Unix)
condition: |
and(
succeeded(),
not(eq(variables['Agent.OS'], 'Windows_NT'))
)
- bash: |
2020-02-20 19:59:44 +00:00
make build-capi-package
2020-02-20 07:14:10 +00:00
cp ./wasmer-c-api.tar.gz ./artifacts/wasmer-c-api-windows.tar.gz
displayName: Build c-api artifacts (Windows)
condition: |
and(
succeeded(),
eq(variables['Agent.OS'], 'Windows_NT')
)
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: library-$(Agent.OS)-$(Agent.OSArchitecture)
2019-08-26 01:18:12 +00:00
- job: Build_Docs
pool:
2020-02-24 19:05:09 +00:00
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
2020-01-14 12:14:59 +00:00
- bash: |
2020-01-14 12:20:41 +00:00
sudo apt-get install doxygen graphviz
2020-01-14 12:14:59 +00:00
displayName: Install doxygen
- bash: |
make docs
2020-01-14 12:14:59 +00:00
displayName: Build docs
2020-01-14 15:50:01 +00:00
- publish: $(System.DefaultWorkingDirectory)/api-docs
2020-01-14 12:14:59 +00:00
artifact: api-docs
2020-01-15 12:21:14 +00:00
displayName: Save Docs artifact
- job: Publish
dependsOn:
2019-09-01 04:30:20 +00:00
- Build_CLI
- Build_Library
2019-11-23 02:59:40 +00:00
condition: |
startsWith(variables['Build.SourceBranch'], 'refs/tags')
steps:
2019-09-01 04:49:57 +00:00
# - download: current
- task: DownloadPipelineArtifact@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
2019-09-01 04:49:57 +00:00
ls $ARTIFACT_STAGING_DIRECTORY
2019-09-01 06:15:48 +00:00
displayName: List Artifacts
env:
2019-09-01 04:49:57 +00:00
ARTIFACT_STAGING_DIRECTORY: $(Build.ArtifactStagingDirectory)
2019-11-11 21:31:38 +00:00
- script: VERSION_TAG=`git describe --tags` && echo "##vso[task.setvariable variable=VERSION_TAG]$VERSION_TAG"
displayName: Set the tag name as an environment variable
- task: GithubRelease@0
2020-03-30 21:45:04 +00:00
displayName: "Create GitHub Release with artifacts"
2019-11-23 02:59:40 +00:00
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
inputs:
2019-11-11 19:23:46 +00:00
gitHubConnection: 'wasmer'
repositoryName: 'wasmerio/wasmer'
action: 'create'
target: '$(Build.SourceVersion)'
2019-11-11 21:31:38 +00:00
title: '$(VERSION_TAG)'
addChangeLog: false
2019-11-11 19:23:46 +00:00
tagSource: 'auto'
# TODO: automate it all by getting the release notes from somewhere else and using the `releaseNotesFile` key
isDraft: false
isPreRelease: false
2019-11-11 22:14:09 +00:00
assets: '$(Build.ArtifactStagingDirectory)/**'
2020-03-11 22:57:26 +00:00
assetUploadMode: 'replace' # Don't delete previously uploaded assets (default)
2019-08-10 18:11:54 +00:00
- job: Publish_Docs
dependsOn:
- Build_Docs
displayName: Deploy API Documentation to GitHub
pool:
2020-02-24 19:05:09 +00:00
vmImage: "ubuntu-16.04"
condition: in(variables['Build.SourceBranch'], 'refs/heads/master')
steps:
- checkout: self
- task: DownloadPipelineArtifact@2
inputs:
2020-01-14 12:14:59 +00:00
artifactName: api-docs
2020-01-14 19:04:07 +00:00
targetPath: $(System.DefaultWorkingDirectory)/api-docs
- bash: |
2020-01-15 08:56:48 +00:00
git config --global user.email "bot@wasmer.io"
git config --global user.name "wasmerbot"
2019-09-16 22:41:15 +00:00
make docs-publish
2020-01-15 10:01:22 +00:00
env:
RUST_DOCS_DIR: $(Pipeline.Workspace)/api-docs
GITHUB_DOCS_TOKEN: $(GITHUB_DOCS_TOKEN)
2020-01-15 11:32:27 +00:00
SOURCE_VERSION: $(Build.SourceVersion)
2019-09-01 06:34:06 +00:00
# We only run the pipelines on PRs to Master
pr:
- master
# Otherwise, we test in any of these branches (master or bors related)
2019-08-10 18:11:54 +00:00
trigger:
2019-09-01 06:39:35 +00:00
- master
- staging
- trying
2019-11-18 21:19:05 +00:00
- refs/tags/*