-
Notifications
You must be signed in to change notification settings - Fork 243
/
azure-pipelines.yml
120 lines (110 loc) · 3.89 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
trigger:
branches:
include:
- master
- feature/ci-dev
paths:
exclude:
- README.md
- LICENSE
- .travis.yml
- book.toml
- docker/*
- 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:
# 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.
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings"
cargo fmt --check
displayName: 'cargo fmt --check'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings"
# Don't build with `--all-features` as `--all-features` includes `--features llvm-static`,
# which we don't want to test here (it doesn't work out of the box on Arch and Fedora;
# see https://github.com/immunant/c2rust/issues/500).
cargo build --release
displayName: 'cargo build against host clang/LLVM (fast build)'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings"
cargo test --release --workspace
displayName: 'cargo test'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
# `test_translator.py` compiles translated code,
# which has tons of warnings.
# `RUSTFLAGS="-D warnings"` would be inherited by that,
# causing tons of errors, so don't set that.
# `test_translator.py` does not rebuild,
# so changing `RUSTFLAGS` will not trigger a full rebuild.
./scripts/test_translator.py tests/
displayName: 'Test translator (fast build)'
- job: Darwin
timeoutInMinutes: 180
pool:
vmImage: 'macOS-latest'
steps:
- script: |
./scripts/provision_mac.sh
# speeds up provisioning
export HOMEBREW_NO_AUTO_UPDATE=1
# prepare environment for the following steps
source $HOME/.cargo/env
# print some useful info to help troubleshoot
brew info llvm@17
which python3
/usr/bin/env python3 -c "import sys; print(sys.path)"
displayName: 'Provision macOS'
- script: |
export LLVM_CONFIG_PATH=$(brew --prefix llvm@17)/bin/llvm-config
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings"
# Don't build with `--all-features` (see analogous step for Linux).
cargo build --release
displayName: 'cargo build against host clang/LLVM (fast build)'
- script: |
$(brew --prefix llvm@17)/bin/llvm-config
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings"
cargo test --release --workspace
displayName: 'cargo test'
- script: |
# `RUSTFLAGS` not set (see analogous step for Linux).
./scripts/test_translator.py tests/
displayName: 'Test translator (fast build)'