forked from immunant/c2rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
132 lines (117 loc) · 4.01 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
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
./scripts/run_ci_checks.sh fmt
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
./scripts/run_ci_checks.sh check
displayName: 'cargo check'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
./scripts/run_ci_checks.sh doc
displayName: 'cargo doc'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
./scripts/run_ci_checks.sh build
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
./scripts/run_ci_checks.sh test
displayName: 'cargo test'
- script: |
export PATH="/home/docker/.cargo/bin:$PATH"
export RUSTUP_HOME=/home/docker/.rustup
export CARGO_HOME=$AGENT_TEMPDIRECTORY/.cargo
./scripts/run_ci_checks.sh test-translator
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
# 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
./scripts/run_ci_checks.sh fmt
displayName: 'cargo fmt --check'
- script: |
export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config
./scripts/run_ci_checks.sh check
displayName: 'cargo check'
- script: |
export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config
./scripts/run_ci_checks.sh doc
displayName: 'cargo doc'
- script: |
export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config
./scripts/run_ci_checks.sh build
displayName: 'cargo build against host clang/LLVM (fast build)'
- script: |
export LLVM_CONFIG_PATH=$(brew --prefix llvm)/bin/llvm-config
./scripts/run_ci_checks.sh test
displayName: 'cargo test'
- script: |
./scripts/run_ci_checks.sh test-translator
displayName: 'Test translator (fast build)'