Skip to content

Commit

Permalink
Slight tweaks to CI
Browse files Browse the repository at this point in the history
* Pass `--quiet` to all tests to have some quieter output
* Skip builds on branches other than `auto-cargo` as it's already checked
* Check the right env var for repo branches on appveyor
* Only run a few builds on PRs
  • Loading branch information
alexcrichton committed Dec 1, 2016
1 parent e61f78c commit 6eb113a
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 26 deletions.
25 changes: 13 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ os: linux
services:
- docker

git:
depth: 1

matrix:
include:
# stable linux builds, tested
- env: TARGET=x86_64-unknown-linux-gnu
ALT=i686-unknown-linux-gnu
IMAGE=dist
MAKE_TARGETS="test distcheck doc install uninstall"
ALLOW_PR=1
- env: TARGET=i686-unknown-linux-gnu
IMAGE=dist
MAKE_TARGETS=test-unit-i686-unknown-linux-gnu
Expand Down Expand Up @@ -99,11 +103,15 @@ before_script:
sh -s -- --add-target=$ALT --disable-sudo -y --prefix=`rustc --print sysroot`;
fi
script:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
SRC=. src/ci/run.sh $TARGET;
else
src/ci/docker/run.sh $IMAGE $TARGET;
fi
- >
if [ "$ALLOW_PR" = "" ] && [ "$TRAVIS_BRANCH" != "auto-cargo" ]; then
echo skipping, not a full build;
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
SRC=. src/ci/run.sh $TARGET;
else
src/ci/docker/run.sh $IMAGE $TARGET;
fi
after_success: |
[ $TRAVIS_BRANCH = master ] &&
[ $TRAVIS_PULL_REQUEST = false ] &&
Expand All @@ -121,13 +129,6 @@ notifications:
email:
on_success: never

branches:
only:
- master
- auto-cargo
- beta
- stable

before_deploy:
- mkdir -p deploy/$TRAVIS_COMMIT
- cp target/$TARGET/release/dist/cargo-*-$TARGET.tar.gz
Expand Down
3 changes: 2 additions & 1 deletion Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ test-unit-$(1): target/openssl/$(1).stamp cargo-$(1)
@mkdir -p $$(CFG_BUILD_DIR)/target/$(1)/cit
$$(CARGO) test --target $(1) \
--manifest-path $(S)Cargo.toml \
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only)
$$(OPT_FLAG) $$(CARGOFLAGS) $$(VERBOSE_FLAG) $$(only) -- \
--quiet
endef
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))

Expand Down
20 changes: 8 additions & 12 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
environment:
matrix:
- TARGET: x86_64-pc-windows-gnu
ARCH: amd64
BITS: 64
CFG_DISABLE_CROSS_TESTS: 1
MAKE_TARGETS: test-unit-x86_64-pc-windows-gnu
- TARGET: i686-pc-windows-gnu
ARCH: x86
BITS: 32
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci
MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
Expand All @@ -15,13 +13,12 @@ environment:
MAKE_TARGETS: test-unit-i686-pc-windows-gnu
- TARGET: i686-pc-windows-msvc
BITS: 32
ARCH: x86
MAKE_TARGETS: test-unit-i686-pc-windows-msvc
CFG_DISABLE_CROSS_TESTS: 1
ALLOW_PR: 1
- TARGET: x86_64-pc-windows-msvc
OTHER_TARGET: i686-pc-windows-msvc
BITS: 64
ARCH: amd64
MAKE_TARGETS: test-unit-x86_64-pc-windows-msvc

install:
Expand All @@ -38,6 +35,8 @@ install:
- cargo -V
- git submodule update --init

clone_depth: 1

build: false

test_script:
Expand All @@ -48,16 +47,13 @@ cache:
- C:\Users\appveyor\.cargo\registry

after_test:
- mkdir %APPVEYOR_REPO_COMMIT%
- ps: New-Item -Path "${env:APPVEYOR_REPO_COMMIT}" -ItemType "directory"
- ps: New-Item -Path "target" -ItemType "directory" -Force
- ps: New-Item -Path "target/${env:TARGET}" -ItemType "directory" -Force
- ps: New-Item -Path "target/${env:TARGET}/release" -ItemType "directory" -Force
- ps: New-Item -Path "target/${env:TARGET}/release/dist" -ItemType "directory" -Force
- ps: Get-ChildItem -Path target\${env:TARGET}\release\dist -Filter '*.tar.gz' | Move-Item -Destination ${env:APPVEYOR_REPO_COMMIT}

branches:
only:
- master
- auto-cargo
- beta
- stable

artifacts:
- path: $(APPVEYOR_REPO_COMMIT)\cargo-*-$(TARGET).tar.gz
name: cargo
Expand Down
3 changes: 3 additions & 0 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ exec docker run \
--env SRC=/checkout \
--env CARGO_HOME=/cargo \
--env TRAVIS_BRANCH=$TRAVIS_BRANCH \
--env TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH \
--env ALLOW_PR=$ALLOW_PR \
--env CI=$CI \
--volume "$HOME/.cargo:/cargo" \
--volume `rustc --print sysroot`:/rust:ro \
--volume `pwd`/target:/tmp/target \
Expand Down
15 changes: 14 additions & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fi

BRANCH=$TRAVIS_BRANCH
if [ "$BRANCH" = "" ]; then
BRANCH=$APPVEYOR_BRANCH
BRANCH=$APPVEYOR_REPO_BRANCH
fi

if [ "$BRANCH" = "stable" ]; then
Expand All @@ -34,6 +34,19 @@ else
CHANNEL=dev
fi

# We want to only run tests in a few situations:
#
# * All tests on the auto-cargo branch
# * One test on PRs
# * Any tests done locally
#
# This means that here if we're on CI, then we skip tests if it's not the right
# branch or if we're not configured to run a test on PRs
if [ -n "$CI" ] && [ "$BRANCH" != "auto-cargo" ] && [ "$ALLOW_PR" = "" ]; then
echo no build necessary, skipping
exit 0
fi

$SRC/configure \
--prefix=/tmp/obj/install \
--target=$TARGET \
Expand Down

0 comments on commit 6eb113a

Please sign in to comment.