Skip to content

Commit 7ba70c3

Browse files
committed
Auto merge of #3350 - alexcrichton:more-tweaks, r=alexcrichton
Slight tweaks to CI * Pass `--quiet` to all tests to have some quieter output * Skip builds on the `master` branch as `auto` is already checked * Check the right env var for repo branches on appveyor
2 parents 80ec9e0 + cf71ae0 commit 7ba70c3

File tree

5 files changed

+40
-26
lines changed

5 files changed

+40
-26
lines changed

.travis.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ os: linux
66
services:
77
- docker
88

9+
git:
10+
depth: 1
11+
912
matrix:
1013
include:
1114
# stable linux builds, tested
1215
- env: TARGET=x86_64-unknown-linux-gnu
1316
ALT=i686-unknown-linux-gnu
1417
IMAGE=dist
1518
MAKE_TARGETS="test distcheck doc install uninstall"
19+
ALLOW_PR=1
1620
- env: TARGET=i686-unknown-linux-gnu
1721
IMAGE=dist
1822
MAKE_TARGETS=test-unit-i686-unknown-linux-gnu
@@ -99,11 +103,15 @@ before_script:
99103
sh -s -- --add-target=$ALT --disable-sudo -y --prefix=`rustc --print sysroot`;
100104
fi
101105
script:
102-
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
103-
SRC=. src/ci/run.sh $TARGET;
104-
else
105-
src/ci/docker/run.sh $IMAGE $TARGET;
106-
fi
106+
- >
107+
if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto-cargo" ]; then
108+
echo skipping, not a full build;
109+
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
110+
SRC=. src/ci/run.sh $TARGET;
111+
else
112+
src/ci/docker/run.sh $IMAGE $TARGET;
113+
fi
114+
107115
after_success: |
108116
[ $TRAVIS_BRANCH = master ] &&
109117
[ $TRAVIS_PULL_REQUEST = false ] &&
@@ -121,13 +129,6 @@ notifications:
121129
email:
122130
on_success: never
123131

124-
branches:
125-
only:
126-
- master
127-
- auto-cargo
128-
- beta
129-
- stable
130-
131132
before_deploy:
132133
- mkdir -p deploy/$TRAVIS_COMMIT
133134
- cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz

Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ test-unit-$(1): target/openssl/$(1).stamp cargo-$(1)
103103
@mkdir -p $$(CFG_BUILD_DIR)/target/$(1)/cit
104104
$$(CARGO) test --target $(1) \
105105
--manifest-path $(S)Cargo.toml \
106-
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only)
106+
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only) -- \
107+
--quiet
107108
endef
108109
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
109110

appveyor.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
environment:
22
matrix:
33
- TARGET: x86_64-pc-windows-gnu
4-
ARCH: amd64
54
BITS: 64
65
CFG_DISABLE_CROSS_TESTS: 1
76
MAKE_TARGETS: test-unit-x86_64-pc-windows-gnu
87
- TARGET: i686-pc-windows-gnu
9-
ARCH: x86
108
BITS: 32
119
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci
1210
MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
@@ -15,13 +13,12 @@ environment:
1513
MAKE_TARGETS: test-unit-i686-pc-windows-gnu
1614
- TARGET: i686-pc-windows-msvc
1715
BITS: 32
18-
ARCH: x86
1916
MAKE_TARGETS: test-unit-i686-pc-windows-msvc
2017
CFG_DISABLE_CROSS_TESTS: 1
18+
ALLOW_PR: 1
2119
- TARGET: x86_64-pc-windows-msvc
2220
OTHER_TARGET: i686-pc-windows-msvc
2321
BITS: 64
24-
ARCH: amd64
2522
MAKE_TARGETS: test-unit-x86_64-pc-windows-msvc
2623

2724
install:
@@ -38,6 +35,8 @@ install:
3835
- cargo -V
3936
- git submodule update --init
4037

38+
clone_depth: 1
39+
4140
build: false
4241

4342
test_script:
@@ -48,16 +47,13 @@ cache:
4847
- C:\Users\appveyor\.cargo\registry
4948

5049
after_test:
51-
- mkdir %APPVEYOR_REPO_COMMIT%
50+
- ps: New-Item -Path "${env:APPVEYOR_REPO_COMMIT}" -ItemType "directory"
51+
- ps: New-Item -Path "target" -ItemType "directory" -Force
52+
- ps: New-Item -Path "target/${env:TARGET}" -ItemType "directory" -Force
53+
- ps: New-Item -Path "target/${env:TARGET}/release" -ItemType "directory" -Force
54+
- ps: New-Item -Path "target/${env:TARGET}/release/dist" -ItemType "directory" -Force
5255
- ps: Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination ${env:APPVEYOR_REPO_COMMIT}
5356

54-
branches:
55-
only:
56-
- master
57-
- auto-cargo
58-
- beta
59-
- stable
60-
6157
artifacts:
6258
- path: $(APPVEYOR_REPO_COMMIT)\cargo-*-$(TARGET).tar.gz
6359
name: cargo

src/ci/docker/run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ exec docker run \
3737
--env SRC=/checkout \
3838
--env CARGO_HOME=/cargo \
3939
--env TRAVIS_BRANCH=$TRAVIS_BRANCH \
40+
--env TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \
41+
--env ALLOW_PR=$ALLOW_PR \
42+
--env CI=$CI \
4043
--volume "$HOME/.cargo:/cargo" \
4144
--volume `rustc --print sysroot`:/rust:ro \
4245
--volume `pwd`/target:/tmp/target \

src/ci/run.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919

2020
BRANCH=$TRAVIS_BRANCH
2121
if [ "$BRANCH" = "" ]; then
22-
BRANCH=$APPVEYOR_BRANCH
22+
BRANCH=$APPVEYOR_REPO_BRANCH
2323
fi
2424

2525
if [ "$BRANCH" = "stable" ]; then
@@ -34,6 +34,19 @@ else
3434
CHANNEL=dev
3535
fi
3636

37+
# We want to only run tests in a few situations:
38+
#
39+
# * All tests on the auto-cargo branch
40+
# * One test on PRs
41+
# * Any tests done locally
42+
#
43+
# This means that here if we're on CI, then we skip tests if it's not the right
44+
# branch or if we're not configured to run a test on PRs
45+
if [ -n "$CI" ] && [ "$BRANCH" != "auto-cargo" ] && [ "$ALLOW_PR" = "" ]; then
46+
echo no build necessary, skipping
47+
exit 0
48+
fi
49+
3750
$SRC/configure \
3851
--prefix=/tmp/obj/install \
3952
--target=$TARGET \

0 commit comments

Comments
 (0)