summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-08-11 11:56:05 -0500
committerGitHub <noreply@github.com>2017-08-11 11:56:05 -0500
commitfdee9f1c83f8bf7cc554a59c2f66d9cbbb09eda4 (patch)
tree692e5116028327411659e53df2d78421edd3bd25
parent3d041783c95c619000bfb16b948b1fd1ded7f0b8 (diff)
parent59b85354a7ce44343ef4bcfd7047b9ea0a6719c6 (diff)
Auto merge of #901 - fitzgen:split-up-ci-into-many-jobs, r=emilio
Run many CI jobs in parallel 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. r? @emilio
-rw-r--r--.travis.yml33
-rwxr-xr-xci/script.sh40
-rwxr-xr-xci/test.sh38
3 files changed, 64 insertions, 47 deletions
diff --git a/.travis.yml b/.travis.yml
index 639832dd..e5d0e105 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,15 +17,32 @@ env:
global:
- CARGO_TARGET_DIR=/tmp/bindgen
matrix:
- - LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_libclang_3_8
- - LLVM_VERSION=3.8.1 BINDGEN_FEATURES=testing_only_libclang_3_8
- - LLVM_VERSION=3.9.0 BINDGEN_FEATURES=testing_only_libclang_3_9
- - LLVM_VERSION=4.0.0 BINDGEN_FEATURES=testing_only_libclang_4
+ - 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=3.7.1 BINDGEN_FEATURES=testing_only_libclang_3_8
+ - env: LLVM_VERSION=4.0.0 BINDGEN_JOB=rustfmt
cache:
directories:
@@ -35,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