From 88cca77fdb0a34f2b69eb0fecdec142ff89b218a Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 25 Dec 2016 15:26:09 +0100 Subject: [PATCH 1/2] Travis: use travis_fold function for folds Ref: https://github.com/travis-ci/travis-build/blob/7cac7d393c7487497bf8164f74892aedf15633c5/lib/travis/shell/generator/bash.rb#L109-L116 --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c50c925c..4779b300 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,13 +115,11 @@ install: # Functions for custom Travis folds. - | travis_fold_start() { - echo -n "travis_" - echo "fold:start:$1" + travis_fold start "$1" travis_fold_current="$1" } travis_fold_end() { - echo -n "travis_" - echo "fold:end:$travis_fold_current" + travis_fold end "$travis_fold_current" } travis_run_in_fold() { travis_fold_start "$1" From 69915fb6585ec483844635d02992d7c75cc6fc25 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 25 Dec 2016 13:13:33 +0100 Subject: [PATCH 2/2] Travis: fix "Testing previous commits" Fixes/massages TRAVIS_COMMIT_RANGE. Ref: https://github.com/awesomeWM/awesome/pull/1298#pullrequestreview-14364986 --- .travis.yml | 12 +++++++----- build-utils/travis-apidoc.sh | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4779b300..7e508747 100644 --- a/.travis.yml +++ b/.travis.yml @@ -179,12 +179,14 @@ script: set -ev if [ "$TEST_PREV_COMMITS" = 1 ] && ! [ "$TRAVIS_PULL_REQUEST" = false ]; then # Check each commit separately (to make git-bisect less annoying). - echo "Testing previous commits based on TRAVIS_COMMIT_RANGE=$TRAVIS_COMMIT_RANGE" - rev_list="$(git rev-list --bisect-all $TRAVIS_COMMIT_RANGE)" + # Fix Travis' commit range (https://github.com/travis-ci/travis-ci/issues/4596). + commit_range="${TRAVIS_COMMIT_RANGE/.../..}" + echo "Testing previous commits ($commit_range)" + rev_list="$(git rev-list --bisect-all $commit_range)" echo "rev-list: $rev_list" - commits="$(echo $rev_list | grep -v 'dist=0' | cut -d\ -f 1)" - echo "Testing commits: $commits" - n="$(echo commits | wc -l)" + commits="$(echo "$rev_list" | grep -v 'dist=0' | cut -d\ -f 1)" + n="$(echo "$commits" | wc -l)" + echo "Testing $n commits: $commits" i=0 failed= for commit in $commits; do diff --git a/build-utils/travis-apidoc.sh b/build-utils/travis-apidoc.sh index 8ece46b6..76e2e8b9 100755 --- a/build-utils/travis-apidoc.sh +++ b/build-utils/travis-apidoc.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # # Process (API) docs after a successful build on Travis (via ../.travis.yml). # @@ -76,7 +76,7 @@ COMMIT_MSG="Update docs for $AWESOME_VERSION via Travis Last commit message: $LAST_COMMIT_MSG -Commits: https://github.com/awesomeWM/awesome/compare/${TRAVIS_COMMIT_RANGE} +Commits: https://github.com/awesomeWM/awesome/compare/${TRAVIS_COMMIT_RANGE/.../..} Build URL: https://travis-ci.org/awesomeWM/awesome/builds/${TRAVIS_BUILD_ID}" git commit -m "[relevant] $COMMIT_MSG"