summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2017-08-10 15:17:03 -0700
committerNick Fitzgerald <fitzgen@gmail.com>2017-08-10 15:27:17 -0700
commit59b85354a7ce44343ef4bcfd7047b9ea0a6719c6 (patch)
tree401046a4b37131f3e750b038fafa7a2aecafbfe9
parent08003a4d14bc1f47ee46e2a18a0ea3154f2438fa (diff)
Run many parallel CI jobs
Our CI is performing multiple different jobs: * For every libclang version we support: * With both debug and release profiles: * Generating bindings from our test headers, with and without extra assertions, and asserting there is no diff from the expectations. * Compiling and testing the generated bindings. * Compiling and testing the bindgen-integration crate. * Testing the md book. * Asserting that there aren't any system includes in any of the test headers. * Asserting that all the pub functions have doc comments. We were previously doing these things sequentially for each libclang version. This commit breaks these jobs up explicitly and runs each of them one at a time so that they can each be run in parallel, on different Travis CI machines.
-rw-r--r--.travis.yml32
-rwxr-xr-xci/script.sh40
-rwxr-xr-xci/test.sh38
3 files changed, 65 insertions, 45 deletions
diff --git a/.travis.yml b/.travis.yml
index 9c79c50e..e5d0e105 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,12 +17,32 @@ env:
global:
- CARGO_TARGET_DIR=/tmp/bindgen
matrix:
- - LLVM_VERSION=3.8.1
- - LLVM_VERSION=3.9.0
- - LLVM_VERSION=4.0.0
+ - LLVM_VERSION="3.8.1" BINDGEN_JOB="test" BINDGEN_PROFILE=
+ - LLVM_VERSION="3.8.1" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="3.8.1" BINDGEN_JOB="integration" BINDGEN_PROFILE=
+ - LLVM_VERSION="3.8.1" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="3.8.1" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
+ - LLVM_VERSION="3.8.1" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="3.9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
+ - LLVM_VERSION="3.9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
+ - LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="3.9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
+ - LLVM_VERSION="3.9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
+ - LLVM_VERSION="4.0.0" BINDGEN_JOB="misc"
matrix:
fast_finish: true
+ allow_failures:
+ - env: LLVM_VERSION=4.0.0 BINDGEN_JOB=rustfmt
cache:
directories:
@@ -32,14 +52,12 @@ cache:
before_install: . ./ci/before_install.sh
script:
- # - ./ci/assert-rustfmt.sh
- - BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/assert-docs.sh
- - BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/test.sh
- - ./ci/test-book.sh
+ - BINDGEN_JOB="$BINDGEN_JOB" BINDGEN_PROFILE="$BINDGEN_PROFILE" BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/script.sh
after_success:
- test "$TRAVIS_PULL_REQUEST" == "false" &&
test "$TRAVIS_BRANCH" == "master" &&
+ test "$BINDGEN_JOB" == "misc" &&
./ci/deploy-book.sh
notifications:
diff --git a/ci/script.sh b/ci/script.sh
new file mode 100755
index 00000000..b23d8b5d
--- /dev/null
+++ b/ci/script.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+set -xeu
+cd "$(dirname "$0")/.."
+
+# Note that `$BINDGEN_PROFILE` is never in quotes so that it expands to nothing
+# (not even an empty string argument) when the variable is empty. This is
+# necessary so we don't pass an unexpected flag to cargo.
+
+export RUST_BACKTRACE=1
+
+case "$BINDGEN_JOB" in
+ "test")
+ cargo test $BINDGEN_PROFILE --features "$BINDGEN_FEATURES"
+ ./ci/assert-no-diff.sh
+ ;;
+
+ "integration")
+ cd ./bindgen-integration
+ cargo test $BINDGEN_PROFILE --features "$BINDGEN_FEATURES"
+ ;;
+
+ "expectations")
+ cd ./tests/expectations
+ cargo test $BINDGEN_PROFILE
+ ;;
+
+ "misc")
+ ./ci/assert-docs.sh
+ ./ci/test-book.sh
+ ./ci/no-includes.sh
+ # `rustfmt` isn't reaching a fixed point on bindgen
+ # code... https://github.com/rust-lang-nursery/rustfmt/issues/1376
+ # ./ci/assert-rustfmt.sh
+ ;;
+
+ *)
+ echo "Error! Unknown \$BINDGEN_JOB: '$BINDGEN_JOB'"
+ exit 1
+esac
diff --git a/ci/test.sh b/ci/test.sh
deleted file mode 100755
index 5d8bb469..00000000
--- a/ci/test.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-
-set -xeu
-cd "$(dirname "$0")/.."
-
-export RUST_BACKTRACE=1
-
-# Disallow system header file includes in our test suite.
-./ci/no-includes.sh
-
-# Regenerate the test headers' bindings in debug and release modes, and assert
-# that we always get the expected generated bindings.
-
-cargo test --features "$BINDGEN_FEATURES"
-./ci/assert-no-diff.sh
-
-cargo test --features "$BINDGEN_FEATURES testing_only_extra_assertions"
-./ci/assert-no-diff.sh
-
-cargo test --release --features "$BINDGEN_FEATURES testing_only_extra_assertions"
-./ci/assert-no-diff.sh
-
-if [[ "${TRAVIS}" == "true" ]]; then
-
- # Now test the expectations' size and alignment tests.
-
- pushd tests/expectations
- cargo test
- cargo test --release
- popd
-
- # And finally, test our example bindgen + build.rs integration template project.
-
- cd bindgen-integration
- cargo test --features "$BINDGEN_FEATURES"
- cargo test --release --features "$BINDGEN_FEATURES"
-
-fi