forked from immunant/c2rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
136 lines (122 loc) · 4.62 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
trigger:
branches:
include:
- master
- feature/ci-dev
paths:
exclude:
- README.md
- LICENSE
- .travis.yml
- book.toml
- docker/*
- vagrant/*
- manual/*
- docs/*
jobs:
- job: Linux
timeoutInMinutes: 120
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
arch:
containerImage: immunant/c2rust:archlinux-base-latest
debian10:
containerImage: immunant/c2rust:debian-buster-latest
debian11:
containerImage: immunant/c2rust:debian-bullseye-latest
fedora34:
containerImage: immunant/c2rust:fedora-34-latest
ubuntu20:
containerImage: immunant/c2rust:ubuntu-focal-latest
ubuntu18:
containerImage: immunant/c2rust:ubuntu-bionic-latest
container: $[ variables['containerImage'] ]
steps:
- script: |
# rust was installed for the `docker` user, not the user azure creates
# but cargo and rustup can be controlled via $CARGO_HOME and $RUSTUP_HOME.
# NOTE: $HOME is not set correctly for the azure user; don't rely on it.
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
cargo build --release
displayName: 'Fast build against host clang/LLVM'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
python3 ./scripts/test_translator.py ./tests
displayName: 'Test translator (fast build)'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
cargo clean
displayName: 'Cargo clean'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
export GNUPGHOME=$AGENT_TEMPDIRECTORY
python3 ./scripts/build_translator.py --with-llvm-version=10.0.1
displayName: 'Developer build against local LLVM 10'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
python3 ./scripts/test_translator.py ./tests
displayName: 'Test translator against developer build (LLVM 10)'
# - script: |
# export PATH="/home/docker/.cargo/bin:$PATH"
# export RUSTUP_HOME=/home/docker/.rustup
# export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
# cargo clean && rm -rf build
# displayName: 'Cargo clean && rm -rf build'
# - script: |
# export PATH="/home/docker/.cargo/bin:$PATH"
# export RUSTUP_HOME=/home/docker/.rustup
# export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
# python3 ./scripts/build_translator.py --with-llvm-version=8.0.0
# displayName: 'Developer build against local LLVM 8'
# - script: |
# export PATH="/home/docker/.cargo/bin:$PATH"
# export RUSTUP_HOME=/home/docker/.rustup
# export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
# python3 ./scripts/test_translator.py ./tests
# displayName: 'Test translator against developer build (LLVM 8)'
- job: Darwin
timeoutInMinutes: 180
pool:
vmImage: 'macOS-latest'
steps:
- script: |
./scripts/provision_mac.sh
# speeds up provisioning
export HOMEBREW_NO_AUTO_UPDATE=1
# helps the `curl-sys` create determine how to link in libcurl.
brew install pkg-config
# we want to use the host curl because it has the `HTTP2` feature
# whereas the brew version does not, this causes curl-sys to
# build its own curl which then fails to link on Azure Devops.
brew remove curl
# prepare environment for the following steps
source $HOME/.cargo/env
brew info llvm
displayName: 'Provision macOS'
- script: |
export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config
cargo build --release
displayName: 'Fast build against host clang/LLVM'
- script: python3 ./scripts/test_translator.py ./tests
displayName: 'Test translator (fast build)'
- script: cargo clean
displayName: 'Cargo clean'
# LLVM 10.0.X on macOS 10.15 and fails with a CMake error but later
# LLVM releases do not. See this issue for an example of the error.
# https://github.com/spack/spack/issues/19905#issuecomment-727268589
- script: python3 ./scripts/build_translator.py --with-llvm-version=11.1.0
displayName: 'Developer build against local LLVM 11'
- script: python3 ./scripts/test_translator.py ./tests
displayName: 'Test translator against developer build (LLVM 11)'