Fix up CI jobs

This commit is contained in:
Travis Burtrum 2020-07-23 00:37:12 -04:00
parent f3a78b2863
commit 2e0ccc1d0e
5 changed files with 62 additions and 45 deletions

View File

@ -14,63 +14,68 @@ env:
# TODO Update this to match the name of your project.
- CRATE_NAME=wireguard-proxy
- OPENSSL_STATIC=1
- CARGO_FEATURES=openssl_vendored
- CARGO_FEATURES=async
matrix:
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
# don't need
include:
# Android
- env: TARGET=aarch64-linux-android DISABLE_TESTS=1
- env: TARGET=arm-linux-androideabi DISABLE_TESTS=1
- env: TARGET=armv7-linux-androideabi DISABLE_TESTS=1
- env: TARGET=i686-linux-android DISABLE_TESTS=1
- env: TARGET=x86_64-linux-android DISABLE_TESTS=1
- env: TARGET=aarch64-linux-android
- env: TARGET=arm-linux-androideabi
- env: TARGET=armv7-linux-androideabi
- env: TARGET=i686-linux-android
- env: TARGET=x86_64-linux-android
# iOS
- env: TARGET=aarch64-apple-ios DISABLE_TESTS=1
os: osx
- env: TARGET=armv7-apple-ios DISABLE_TESTS=1 CARGO_FEATURES=default
os: osx
- env: TARGET=armv7s-apple-ios DISABLE_TESTS=1 CARGO_FEATURES=default
os: osx
- env: TARGET=i386-apple-ios DISABLE_TESTS=1 CARGO_FEATURES=default
os: osx
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1 CARGO_FEATURES=default
- env: TARGET=x86_64-apple-ios DISABLE_TESTS=1
os: osx
# Linux
- env: TARGET=aarch64-unknown-linux-gnu
- env: TARGET=aarch64-unknown-linux-musl
- env: TARGET=arm-unknown-linux-gnueabi
- env: TARGET=arm-unknown-linux-gnueabihf
- env: TARGET=arm-unknown-linux-musleabi
- env: TARGET=arm-unknown-linux-musleabihf
- env: TARGET=armv5te-unknown-linux-gnueabi
- env: TARGET=armv5te-unknown-linux-musleabi
- env: TARGET=armv7-unknown-linux-gnueabihf
- env: TARGET=armv7-unknown-linux-musleabihf
- env: TARGET=i586-unknown-linux-gnu
- env: TARGET=i586-unknown-linux-musl
- env: TARGET=i686-unknown-linux-gnu
- env: TARGET=i686-unknown-linux-musl
- env: TARGET=mips-unknown-linux-gnu
- env: TARGET=mips64-unknown-linux-gnuabi64
- env: TARGET=mips64el-unknown-linux-gnuabi64
- env: TARGET=mipsel-unknown-linux-gnu
- env: TARGET=powerpc-unknown-linux-gnu
- env: TARGET=powerpc64-unknown-linux-gnu
- env: TARGET=powerpc64le-unknown-linux-gnu
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1
- env: TARGET=mips-unknown-linux-gnu CARGO_FEATURES=openssl_vendored
- env: TARGET=mips-unknown-linux-musl CARGO_FEATURES=openssl_vendored
- env: TARGET=mips64-unknown-linux-gnuabi64 CARGO_FEATURES=openssl_vendored
- env: TARGET=mips64el-unknown-linux-gnuabi64 CARGO_FEATURES=openssl_vendored
- env: TARGET=mipsel-unknown-linux-gnu CARGO_FEATURES=openssl_vendored
- env: TARGET=mipsel-unknown-linux-musl CARGO_FEATURES=openssl_vendored
- env: TARGET=powerpc-unknown-linux-gnu CARGO_FEATURES=openssl_vendored
- env: TARGET=powerpc64le-unknown-linux-gnu CARGO_FEATURES=openssl_vendored
# neither openssl nor rustls support poor riscv64gc...
- env: TARGET=riscv64gc-unknown-linux-gnu CARGO_FEATURES=verbose
- env: TARGET=s390x-unknown-linux-gnu DISABLE_TESTS=1 CARGO_FEATURES=openssl_vendored
- env: TARGET=x86_64-unknown-linux-gnu
- env: TARGET=x86_64-unknown-linux-musl
# Solaris, neither openssl nor rustls support poor solaris...
- env: TARGET=sparcv9-sun-solaris DISABLE_TESTS=1 CARGO_FEATURES=verbose
- env: TARGET=x86_64-sun-solaris DISABLE_TESTS=1 CARGO_FEATURES=verbose
# OSX
- env: TARGET=i686-apple-darwin
os: osx
- env: TARGET=x86_64-apple-darwin
os: osx
# *BSD
# travis-ci freebsd is broken now for some reason
# - env: TARGET=i686-unknown-freebsd DISABLE_TESTS=1
# - env: TARGET=x86_64-unknown-freebsd DISABLE_TESTS=1
# netbsd fails with vendored openssl, but built in one is fine
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1 CARGO_FEATURES=tls
- env: TARGET=x86_64-unknown-netbsd DISABLE_TESTS=1
# Windows
- env: TARGET=x86_64-pc-windows-gnu CARGO_FEATURES=default
# wine blows up in testing with async build
- env: TARGET=x86_64-pc-windows-gnu DISABLE_TESTS=1
# Bare metal
# These targets don't support std and as such are likely not suitable for

View File

@ -11,16 +11,14 @@ environment:
CRATE_NAME: wireguard-proxy
# gnu fails to compile with any openssl combo for some reason
OPENSSL_STATIC: 1
CARGO_FEATURES: openssl_vendored
CARGO_FEATURES: async
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
# don't need
matrix:
# MinGW
- TARGET: i686-pc-windows-gnu
CARGO_FEATURES: default
- TARGET: x86_64-pc-windows-gnu
CARGO_FEATURES: default
# MSVC
- TARGET: i686-pc-windows-msvc
@ -28,7 +26,6 @@ environment:
# Testing other channels
- TARGET: x86_64-pc-windows-gnu
CARGO_FEATURES: default
RUST_VERSION: nightly
- TARGET: x86_64-pc-windows-msvc
RUST_VERSION: nightly
@ -55,7 +52,7 @@ test_script:
cargo run --target %TARGET% --release --features %CARGO_FEATURES% --bin udp-test -- -is
)
# todo: should run --pinnedpubkey test here where we expect failure, but unsure how to do that with windows, help?
- if [%CARGO_FEATURES%]==[openssl_vendored] (
- if [%CARGO_FEATURES%]==[async] (
cargo run --target %TARGET% --release --features %CARGO_FEATURES% --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem &&
cargo run --target %TARGET% --release --features %CARGO_FEATURES% --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4dE=
)

View File

@ -8,7 +8,10 @@ main() {
test -f Cargo.lock || cargo generate-lockfile
# TODO Update this to build the artifacts that matter to you
cross rustc --bin wireguard-proxy --target $TARGET --release --features $CARGO_FEATURES -- -C lto
cross rustc --bin wireguard-proxy --target $TARGET --release --no-default-features --features $CARGO_FEATURES
# to check how they are built
file target/$TARGET/release/wireguard-proxy* || echo 'file failed'
# TODO Update this to package the right artifacts, this needs to handle .exe too...
case $TARGET in

View File

@ -4,29 +4,33 @@ set -ex
# TODO This is the "test phase", tweak it as you see fit
main() {
cross build --target $TARGET --release --features $CARGO_FEATURES
cross rustc --bin wireguard-proxy --target $TARGET --release --no-default-features --features $CARGO_FEATURES
cross rustc --bin udp-test --target $TARGET --release --no-default-features --features $CARGO_FEATURES
# to check how they are built
file target/$TARGET/release/wireguard-proxy* target/$TARGET/release/udp-test* || echo 'file failed'
if [ ! -z $DISABLE_TESTS ]; then
return
fi
# first make sure udp-test succeeds running against itself
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test
cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test
# now run udp-test through proxy/proxyd
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is
cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is
if [ $CARGO_FEATURES != "default" ]; then
if [ $CARGO_FEATURES != "verbose" ]; then
# run TLS tests then too
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem
cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem
# now pubkey tests
# one that should fail (wrong pinnedpubkey lowercase e at end instead of uppercase E)
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4de= && exit 1 || true
cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4de= && exit 1 || true
# and one that should pass
cross run --target $TARGET --release --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4dE=
cross run --target $TARGET --release --no-default-features --features $CARGO_FEATURES --bin udp-test -- -is --tls-key ci/cert.key --tls-cert ci/cert.pem --pinnedpubkey sha256//BEyQeSjwwUBLXXNuCILHRWyV1gLmY31CdMHNA4VH4dE=
fi
}

14
test.sh
View File

@ -41,12 +41,12 @@ udp-test -s "$@" || exit 1
# first run without TLS
cargo clean
cargo build --release || exit 1
cargo build --release --no-default-features || exit 1
run_tests || exit 1
# first run with non-vendored tls
cargo clean
cargo build --release --features tls || exit 1
cargo build --release --no-default-features --features tls || exit 1
# first plaintext tests
run_tests || exit 1
# then TLS tests
@ -54,7 +54,15 @@ run_tests --tls --tls-key ci/cert.key --tls-cert ci/cert.pem || exit 1
# second run with vendored tls
cargo clean
cargo build --release --features openssl_vendored || exit 1
cargo build --release --no-default-features --features openssl_vendored || exit 1
# first plaintext tests
run_tests || exit 1
# then TLS tests
run_tests --tls --tls-key ci/cert.key --tls-cert ci/cert.pem || exit 1
# third run with async+rustls
cargo clean
cargo build --release --no-default-features --features async || exit 1
# first plaintext tests
run_tests || exit 1
# then TLS tests