Skip to content

Commit 548466d

Browse files
committed
Add Azure Pipelines
1 parent d387e0e commit 548466d

File tree

5 files changed

+247
-141
lines changed

5 files changed

+247
-141
lines changed

.travis.yml

Lines changed: 0 additions & 134 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
trigger:
2+
- master
3+
4+
jobs:
5+
- job: DockerLinux
6+
pool:
7+
vmImage: ubuntu-16.04
8+
steps:
9+
- template: ci/azure-install-rust.yml
10+
- bash: |
11+
if [ "${NO_DOCKER}" = "1" ]; then
12+
ci/run.sh $TARGET
13+
else
14+
ci/run-docker.sh $TARGET
15+
fi
16+
displayName: Execute run-docker.sh
17+
strategy:
18+
matrix:
19+
i586-unknown-linux-gnu:
20+
TARGET: i586-unknown-linux-gnu
21+
i686-unknown-linux-gnu:
22+
TARGET: i686-unknown-linux-gnu
23+
x86_64-unknown-linux-gnu:
24+
TARGET: x86_64-unknown-linux-gnu
25+
x86_64-unknown-linux-gnu-emulated:
26+
TARGET: x86_64-unknown-linux-gnu-emulated
27+
STDARCH_TEST_EVERYTHING: 1
28+
RUSTFLAGS: --cfg stdarch_intel_sde
29+
x86_64-linux-android:
30+
TARGET: x86_64-linux-android
31+
STDARCH_DISABLE_ASSERT_INSTR: 1
32+
arm-unknown-linux-gnueabihf:
33+
TARGET: arm-unknown-linux-gnueabihf
34+
arm-linux-androideabi:
35+
TARGET: arm-linux-androideabi
36+
STDARCH_DISABLE_ASSERT_INSTR: 1
37+
armv7-unknown-linux-gnueabihf:
38+
TARGET: armv7-unknown-linux-gnueabihf
39+
RUSTFLAGS: -C target-feature=+neon
40+
aarch64-unknown-linux-gnu:
41+
TARGET: aarch64-unknown-linux-gnu
42+
mips-unknown-linux-gnu:
43+
TARGET: mips-unknown-linux-gnu
44+
NORUN: 1
45+
mipsel-unknown-linux-musl:
46+
TARGET: mipsel-unknown-linux-musl
47+
NORUN: 1
48+
mips64-unknown-linux-gnuabi64:
49+
TARGET: mips64-unknown-linux-gnuabi64
50+
NORUN: 1
51+
mips64el-unknown-linux-gnuabi64:
52+
TARGET: mips64el-unknown-linux-gnuabi64
53+
NORUN: 1
54+
aarch64-linux-android:
55+
TARGET: aarch64-linux-android
56+
STDARCH_DISABLE_ASSERT_INSTR: 1
57+
#powerpc-unknown-linux-gnu:
58+
# TARGET: powerpc-unknown-linux-gnu
59+
# STDARCH_DISABLE_ASSERT_INSTR: 1
60+
#powerpc64-unknown-linux-gnu:
61+
# TARGET: powerpc64-unknown-linux-gnu
62+
# STDARCH_DISABLE_ASSERT_INSTR: 1
63+
powerpc64le-unknown-linux-gnu:
64+
TARGET: powerpc64le-unknown-linux-gnu
65+
STDARCH_DISABLE_ASSERT_INSTR: 1
66+
s390x-unknown-linux-gnu:
67+
TARGET: s390x-unknown-linux-gnu
68+
wasm32-unknown-unknown:
69+
TARGET: wasm32-unknown-unknown
70+
nvptx64-nvidia-cuda:
71+
TARGET: nvptx64-nvidia-cuda
72+
NORUN: 1
73+
NOSTD: 1
74+
thumbv6m-none-eabi:
75+
TARGET: thumbv6m-none-eabi
76+
NORUN: 1
77+
NOSTD: 1
78+
NO_DOCKER: 1
79+
thumbv7m-none-eabi:
80+
TARGET: thumbv7m-none-eabi
81+
NORUN: 1
82+
NOSTD: 1
83+
NO_DOCKER: 1
84+
thumbv7em-none-eabi:
85+
TARGET: thumbv7em-none-eabi
86+
NORUN: 1
87+
NOSTD: 1
88+
NO_DOCKER: 1
89+
thumbv7em-none-eabihf:
90+
TARGET: thumbv7em-none-eabihf
91+
NORUN: 1
92+
NOSTD: 1
93+
NO_DOCKER: 1
94+
95+
- job: DockerOSX64
96+
pool:
97+
vmImage: macos-10.14
98+
steps:
99+
- template: ci/azure-install-rust.yml
100+
- bash: sh ./ci/run.sh $TARGET
101+
displayName: Execute run.sh
102+
strategy:
103+
matrix:
104+
x86_64-apple-darwin:
105+
TARGET: x86_64-apple-darwin
106+
NO_DOCKER: 1
107+
108+
- job: DockerOSX32
109+
pool:
110+
vmImage: macos-10.13
111+
steps:
112+
- template: ci/azure-install-rust.yml
113+
- bash: sh ./ci/run.sh $TARGET
114+
displayName: Execute run.sh
115+
strategy:
116+
matrix:
117+
i686-apple-darwin:
118+
TARGET: i686-apple-darwin
119+
NO_DOCKER: 1
120+
121+
- job: StyleAndDocs
122+
pool:
123+
vmImage: ubuntu-16.04
124+
steps:
125+
- template: ci/azure-install-rust.yml
126+
- script: sh ci/style.sh
127+
displayName: Check style
128+
- script: sh ci/dox.sh
129+
displayName: Generate and upload documentation
130+
variables:
131+
CI: 1
132+
133+
- job: AutomaticVerification
134+
pool:
135+
vmImage: ubuntu-16.04
136+
steps:
137+
- template: ci/azure-install-rust.yml
138+
- script: cargo test --manifest-path crates/stdarch-verify/Cargo.toml
139+
displayName: Automatic verification
140+
141+
- job: GameBoyAdvance
142+
pool:
143+
vmImage: ubuntu-16.04
144+
steps:
145+
- template: ci/azure-install-rust.yml
146+
- script: rustup component add rust-src
147+
displayName: Add rust-src
148+
- script: (test -x $HOME/.cargo/bin/cargo-xbuild || cargo install cargo-xbuild)
149+
displayName: Add cargo-xbuild
150+
# Obtain the devkitPro tools, using `target/` as a temp directory. This
151+
# is required because we need to use their linker. `lld` uses the `BLX`
152+
# instruction, which was not available in thumb state code until ARMv5.
153+
- script: |
154+
mkdir -p target
155+
cd target
156+
wget https://github.com/devkitPro/pacman/releases/download/devkitpro-pacman-1.0.1/devkitpro-pacman.deb
157+
sudo dpkg -i devkitpro-pacman.deb
158+
sudo dkp-pacman -Sy
159+
sudo dkp-pacman -Syu
160+
sudo dkp-pacman -S -v --noconfirm gba-tools devkitARM
161+
export PATH="$PATH:/opt/devkitpro/devkitARM/bin"
162+
export PATH="$PATH:/opt/devkitpro/tools/bin"
163+
cd ..
164+
# Pull the target spec up into the current directory and then build
165+
mv ci/gba.json gba.json
166+
cargo xbuild -p core_arch --target gba.json
167+
variables:
168+
NORUN: 1
169+
NOSTD: 1
170+
NO_DOCKER: 1

ci/azure-install-rust.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
steps:
2+
- bash: |
3+
set -ex
4+
toolchain=$TOOLCHAIN
5+
if [ "$toolchain" = "" ]; then
6+
toolchain=nightly
7+
fi
8+
if command -v rustup; then
9+
rustup update $toolchain
10+
rustup default $toolchain
11+
else
12+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain
13+
echo "##vso[task.prependpath]$HOME/.cargo/bin"
14+
fi
15+
displayName: Install rust (unix)
16+
condition: ne( variables['Agent.OS'], 'Windows_NT' )
17+
- script: |
18+
if not defined TOOLCHAIN set TOOLCHAIN=nightly
19+
curl -sSf -o rustup-init.exe https://win.rustup.rs
20+
rustup-init.exe -y --default-toolchain %TOOLCHAIN%-%TARGET%
21+
echo ##vso[task.prependpath]%USERPROFILE%\.cargo\bin
22+
displayName: Install rust (windows)
23+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
24+
- script: |
25+
set -ex
26+
if [ -n "${TARGET}" ] && [ "${TARGET}" != "x86_64-unknown-linux-gnu-emulated" ]; then
27+
rustup target add $TARGET
28+
fi
29+
condition: ne( variables['Agent.OS'], 'Windows_NT' )
30+
displayName: Install target (unix)
31+
- script: if defined TARGET rustup target add %TARGET%
32+
condition: eq( variables['Agent.OS'], 'Windows_NT' )
33+
displayName: Install target (windows)
34+
- script: |
35+
set -ex
36+
rustc -Vv
37+
cargo -V
38+
rustup -Vv
39+
rustup show
40+
which rustc
41+
which cargo
42+
which rustup
43+
displayName: Query rust and cargo versions
44+
- script: |
45+
set -ex
46+
cargo generate-lockfile
47+
displayName: Generate lockfiles
48+

ci/run-docker.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ run() {
1313
echo "Running docker"
1414
# shellcheck disable=SC2016
1515
docker run \
16-
--user "$(id -u)":"$(id -g)" \
1716
--rm \
18-
--init \
19-
--volume "${HOME}"/.cargo:/cargo-h \
20-
--env CARGO_HOME=/cargo-h \
21-
--volume "$(rustc --print sysroot)":/rust:ro \
17+
--user "$(id -u)":"$(id -g)" \
18+
--env CARGO_HOME=/cargo \
19+
--env CARGO_TARGET_DIR=/checkout/target \
2220
--env TARGET="${target}" \
2321
--env STDARCH_TEST_EVERYTHING \
2422
--env STDARCH_ASSERT_INSTR_IGNORE \
@@ -27,13 +25,15 @@ run() {
2725
--env NORUN \
2826
--env RUSTFLAGS \
2927
--env STDARCH_TEST_NORUN \
28+
--volume "$(dirname "$(dirname "$(command -v cargo)")")":/cargo \
29+
--volume "$(rustc --print sysroot)":/rust:ro \
3030
--volume "$(pwd)":/checkout:ro \
3131
--volume "$(pwd)"/target:/checkout/target \
32+
--init \
3233
--workdir /checkout \
3334
--privileged \
3435
stdarch \
35-
bash \
36-
-c 'PATH=/rust/bin:$PATH exec ci/run.sh'
36+
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/run.sh ${1}"
3737
}
3838

3939
if [ -z "$1" ]; then

0 commit comments

Comments
 (0)