Skip to content

Commit fdee9f1

Browse files
author
bors-servo
authored
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
2 parents 3d04178 + 59b8535 commit fdee9f1

File tree

3 files changed

+64
-47
lines changed

3 files changed

+64
-47
lines changed

.travis.yml

+24-9
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,32 @@ env:
1717
global:
1818
- CARGO_TARGET_DIR=/tmp/bindgen
1919
matrix:
20-
- LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_libclang_3_8
21-
- LLVM_VERSION=3.8.1 BINDGEN_FEATURES=testing_only_libclang_3_8
22-
- LLVM_VERSION=3.9.0 BINDGEN_FEATURES=testing_only_libclang_3_9
23-
- LLVM_VERSION=4.0.0 BINDGEN_FEATURES=testing_only_libclang_4
20+
- LLVM_VERSION="3.8.1" BINDGEN_JOB="test" BINDGEN_PROFILE=
21+
- LLVM_VERSION="3.8.1" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
22+
- LLVM_VERSION="3.8.1" BINDGEN_JOB="integration" BINDGEN_PROFILE=
23+
- LLVM_VERSION="3.8.1" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
24+
- LLVM_VERSION="3.8.1" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
25+
- LLVM_VERSION="3.8.1" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
26+
- LLVM_VERSION="3.9.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
27+
- LLVM_VERSION="3.9.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
28+
- LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
29+
- LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
30+
- LLVM_VERSION="3.9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
31+
- LLVM_VERSION="3.9.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
32+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
33+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
34+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
35+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
36+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
37+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
38+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
39+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
40+
- LLVM_VERSION="4.0.0" BINDGEN_JOB="misc"
2441

2542
matrix:
2643
fast_finish: true
2744
allow_failures:
28-
- env: LLVM_VERSION=3.7.1 BINDGEN_FEATURES=testing_only_libclang_3_8
45+
- env: LLVM_VERSION=4.0.0 BINDGEN_JOB=rustfmt
2946

3047
cache:
3148
directories:
@@ -35,14 +52,12 @@ cache:
3552
before_install: . ./ci/before_install.sh
3653

3754
script:
38-
# - ./ci/assert-rustfmt.sh
39-
- BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/assert-docs.sh
40-
- BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/test.sh
41-
- ./ci/test-book.sh
55+
- BINDGEN_JOB="$BINDGEN_JOB" BINDGEN_PROFILE="$BINDGEN_PROFILE" BINDGEN_FEATURES="$BINDGEN_FEATURES" ./ci/script.sh
4256

4357
after_success:
4458
- test "$TRAVIS_PULL_REQUEST" == "false" &&
4559
test "$TRAVIS_BRANCH" == "master" &&
60+
test "$BINDGEN_JOB" == "misc" &&
4661
./ci/deploy-book.sh
4762

4863
notifications:

ci/script.sh

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
3+
set -xeu
4+
cd "$(dirname "$0")/.."
5+
6+
# Note that `$BINDGEN_PROFILE` is never in quotes so that it expands to nothing
7+
# (not even an empty string argument) when the variable is empty. This is
8+
# necessary so we don't pass an unexpected flag to cargo.
9+
10+
export RUST_BACKTRACE=1
11+
12+
case "$BINDGEN_JOB" in
13+
"test")
14+
cargo test $BINDGEN_PROFILE --features "$BINDGEN_FEATURES"
15+
./ci/assert-no-diff.sh
16+
;;
17+
18+
"integration")
19+
cd ./bindgen-integration
20+
cargo test $BINDGEN_PROFILE --features "$BINDGEN_FEATURES"
21+
;;
22+
23+
"expectations")
24+
cd ./tests/expectations
25+
cargo test $BINDGEN_PROFILE
26+
;;
27+
28+
"misc")
29+
./ci/assert-docs.sh
30+
./ci/test-book.sh
31+
./ci/no-includes.sh
32+
# `rustfmt` isn't reaching a fixed point on bindgen
33+
# code... https://github.com/rust-lang-nursery/rustfmt/issues/1376
34+
# ./ci/assert-rustfmt.sh
35+
;;
36+
37+
*)
38+
echo "Error! Unknown \$BINDGEN_JOB: '$BINDGEN_JOB'"
39+
exit 1
40+
esac

ci/test.sh

-38
This file was deleted.

0 commit comments

Comments
 (0)