Merge pull request #279 from alexcrichton/configure-azure-pipelines

Configure Azure Pipelines
This commit is contained in:
Alex Crichton 2019-04-02 14:44:08 -05:00 committed by GitHub
commit a771cba5f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 114 additions and 60 deletions

View File

@ -1,7 +1,6 @@
trigger: trigger:
- master - master
pr:
- master
jobs: jobs:
- job: Linux - job: Linux
pool: pool:
@ -10,8 +9,47 @@ jobs:
- template: ci/azure-steps.yml - template: ci/azure-steps.yml
strategy: strategy:
matrix: matrix:
aarch64-unknown-linux-gnu: aarch64:
TARGET: aarch64-unknown-linux-gnu TARGET: aarch64-unknown-linux-gnu
arm:
TARGET: arm-unknown-linux-gnueabi
armhf:
TARGET: arm-unknown-linux-gnueabihf
i586:
TARGET: i586-unknown-linux-gnu
i686:
TARGET: i686-unknown-linux-gnu
mips:
TARGET: mips-unknown-linux-gnu
mips64:
TARGET: mips64-unknown-linux-gnuabi64
mips64el:
TARGET: mips64el-unknown-linux-gnuabi64
mipsel:
TARGET: mipsel-unknown-linux-gnu
powerpc:
TARGET: powerpc-unknown-linux-gnu
powerpc64:
TARGET: powerpc64-unknown-linux-gnu
powerpc64le:
TARGET: powerpc64le-unknown-linux-gnu
# thumbv6m:
# TARGET: thumbv6m-linux-eabi
# XARGO: 1
# thumbv7em:
# TARGET: thumbv7em-linux-eabi
# XARGO: 1
# thumbv7emhf:
# TARGET: thumbv7em-linux-eabihf
# XARGO: 1
# thumbv7m:
# TARGET: thumbv7m-linux-eabi
# XARGO: 1
wasm32:
TARGET: wasm32-unknown-unknown
ONLY_BUILD: 1
x86_64:
TARGET: x86_64-unknown-linux-gnu
- job: macOS - job: macOS
pool: pool:
@ -20,8 +58,10 @@ jobs:
- template: ci/azure-steps.yml - template: ci/azure-steps.yml
strategy: strategy:
matrix: matrix:
x86_64-apple-darwin: x86_64:
TARGET: x86_64-apple-darwin TARGET: x86_64-apple-darwin
i686:
TARGET: i686-apple-darwin
- job: Windows - job: Windows
pool: pool:
@ -30,5 +70,11 @@ jobs:
- template: ci/azure-steps.yml - template: ci/azure-steps.yml
strategy: strategy:
matrix: matrix:
i686-pc-windows-msvc: i686-msvc:
TARGET: i686-pc-windows-msvc TARGET: i686-pc-windows-msvc
x86_64-msvc:
TARGET: x86_64-pc-windows-msvc
i686-gnu:
TARGET: i686-pc-windows-gnu
x86_64-gnu:
TARGET: x86_64-pc-windows-gnu

View File

@ -13,7 +13,7 @@ steps:
- script: | - script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %TOOLCHAIN% rustup-init.exe -y --default-toolchain %TOOLCHAIN%-%TARGET%
echo ##vso[task.prependpath]%USERPROFILE%\.cargo\bin echo ##vso[task.prependpath]%USERPROFILE%\.cargo\bin
displayName: Install rust displayName: Install rust
condition: eq( variables['Agent.OS'], 'Windows_NT' ) condition: eq( variables['Agent.OS'], 'Windows_NT' )

View File

@ -1,12 +1,26 @@
steps: steps:
- checkout: self - checkout: self
submodules: true submodules: true
- template: azure-install-rust.yml - template: azure-install-rust.yml
- script: rustup component add rust-src
displayName: Install Rust sources
condition: eq( variables['XARGO'], '1' )
- bash: rustup target add $TARGET
displayName: Install Rust target
condition: ne( variables['XARGO'], '1' )
- bash: ./ci/run.sh $TARGET - bash: ./ci/run.sh $TARGET
condition: ne( variables['Agent.OS'], 'Linux' ) condition: ne( variables['Agent.OS'], 'Linux' )
displayName: Run test script displayName: Run test script
- bash: ./ci/run-docker.sh $TARGET - bash: |
if [ "$ONLY_BUILD" = "1" ]; then
cargo build --target $TARGET
else
cargo generate-lockfile && ./ci/run-docker.sh $TARGET
fi
condition: eq( variables['Agent.OS'], 'Linux' ) condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Run docker test script displayName: Run docker test script

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \ gcc libc6-dev ca-certificates \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \ gcc libc6-dev ca-certificates \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \ gcc libc6-dev ca-certificates \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates \ gcc libc6-dev ca-certificates \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates gcc-multilib libc6-dev ca-certificates

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc-multilib libc6-dev ca-certificates gcc-multilib libc6-dev ca-certificates

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates \ ca-certificates \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static ca-certificates curl gcc gcc-arm-none-eabi libc6-dev libcurl4-openssl-dev libssh2-1 libnewlib-dev qemu-user-static

View File

@ -1,4 +1,4 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates gcc libc6-dev ca-certificates

3
ci/run-docker.sh Normal file → Executable file
View File

@ -18,12 +18,13 @@ run() {
--user $(id -u):$(id -g) \ --user $(id -u):$(id -g) \
-e CARGO_HOME=/cargo \ -e CARGO_HOME=/cargo \
-e CARGO_TARGET_DIR=/target \ -e CARGO_TARGET_DIR=/target \
-e XARGO \
-v $HOME/.cargo:/cargo \ -v $HOME/.cargo:/cargo \
-v `pwd`/target:/target \ -v `pwd`/target:/target \
-v `pwd`:/checkout:ro \ -v `pwd`:/checkout:ro \
-v `rustc --print sysroot`:/rust:ro \ -v `rustc --print sysroot`:/rust:ro \
-w /checkout \ -w /checkout \
-it $target \ $target \
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin ci/run.sh $target" sh -c "HOME=/tmp PATH=\$PATH:/rust/bin ci/run.sh $target"
} }

View File

@ -3,14 +3,10 @@ set -ex
# FIXME(japarix/xargo#186) this shouldn't be necessary # FIXME(japarix/xargo#186) this shouldn't be necessary
export RUST_TARGET_PATH=`pwd` export RUST_TARGET_PATH=`pwd`
case $1 in
thumb*)
cargo=xargo
;;
*)
cargo=cargo cargo=cargo
;; if [ "$XARGO" = "1" ]; then
esac cargo=xargo
fi
INTRINSICS_FEATURES="c" INTRINSICS_FEATURES="c"
@ -22,8 +18,7 @@ if [ -z "$INTRINSICS_FAILS_WITH_MEM_FEATURE" ]; then
fi fi
# Test our implementation # Test our implementation
case $1 in if [ "$XARGO" = "1" ]; then
thumb*)
run="xargo test --manifest-path testcrate/Cargo.toml --target $1" run="xargo test --manifest-path testcrate/Cargo.toml --target $1"
for t in $(ls testcrate/tests); do for t in $(ls testcrate/tests); do
t=${t%.rs} t=${t%.rs}
@ -41,15 +36,13 @@ case $1 in
$run --test $t --no-default-features --features 'mem c' --no-run --release $run --test $t --no-default-features --features 'mem c' --no-run --release
qemu-arm-static target/${1}/release/$t-* qemu-arm-static target/${1}/release/$t-*
done done
;; else
*)
run="cargo test --manifest-path testcrate/Cargo.toml --target $1" run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
$run $run
$run --release $run --release
$run --features c $run --features c
$run --features c --release $run --features c --release
;; fi
esac
PREFIX=$(echo $1 | sed -e 's/unknown-//')- PREFIX=$(echo $1 | sed -e 's/unknown-//')-
case $1 in case $1 in