nix/ci/script.sh
Alan Somers bf7a5fd606 Switch all builds from Travis to Cirrus
Travis has been super-slow lately (> 6 hours per build).  Cirrus is much
faster: about 20 minutes.  Cirrus also has slightly better test
coverage, mainly because it doesn't use SECCOMP.

Also,

* Fix the Redox CI build.  The old Travis configuration didn't actually
  build for Redox, so we never noticed that Redox can't be built with a
  stable compiler.  Thanks to @coolreader18 for finding this.

* Disable the udp_offload tests on cross-tested platforms.  These tests
  are failing with ENOPROTOOPT in Cirrus-CI.  I suspect it's due to a
  lack of support in QEMU.  These tests were skipped on Travis because
  its kernel was too old.

* Fix require_kernel_version on Cirrus-CI.  Cirrus reports the Linux
  kernel version as 4.19.112+, which the semver crate can't handle.

* Fix test_setfsuid on Cirrus.  When run on Cirrus, it seems like the
  file in /tmp gets deleted as soon as it's closed.  Probably an
  overzealous temporary file cleaner.  Use /var/tmp, because no
  temporary file cleaner should run in there.

* Skip mount tests on Cirrus.  They fail for an unknown reason.
Issue #1351

* Skip the AF_ALG tests on Cirrus-CI
Issue #1352
2020-12-06 22:35:30 -07:00

32 lines
665 B
Bash

#!/bin/bash
# This script takes care of testing your crate
set -ex
main() {
# Add a cfg spec to allow disabling specific tests under CI.
if [ "$CIRRUS_CI" = true ]; then
export RUSTFLAGS=--cfg=cirrus
fi
IFS=';' read -ra TARGET_ARRAY <<< "$TARGET"
for t in "${TARGET_ARRAY[@]}"; do
# Build debug and release targets
cross build --target $t
cross build --target $t --release
if [ ! -z $DISABLE_TESTS ]; then
continue
fi
# Run tests on debug and release targets.
cross test --target $t
cross test --target $t --release
done
}
# we don't run the "test phase" when doing deploys
if [ -z $CIRRUS_TAG ]; then
main
fi