Skip to content
This repository has been archived by the owner on Nov 30, 2024. It is now read-only.

Commit

Permalink
Updated ci build scripts (from rspec-dev)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Nov 16, 2020
1 parent 0a6dd4b commit f86de8d
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# This file contains defaults for RSpec projects. Individual projects
Expand Down
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# In order to install old Rubies, we need to use old Ubuntu distibution.
Expand All @@ -19,15 +19,6 @@ rvm:
- 1.9.2
- 1.9.3
- 2.0.0
- 2.1
- 2.2.10
- 2.3.8
- 2.4.10
- 2.5.8
- 2.6.6
- 2.7.1
- ruby-3.0.0-preview1
- ruby-head
- ree
- rbx-3
- jruby-9.1.7.0 # pin JRuby to this until travis/rvm can install later versions
Expand All @@ -41,6 +32,8 @@ matrix:
env: JRUBY_OPTS='--dev --1.8'
- rvm: 2.7.1
env: DIFF_LCS_VERSION="~> 1.3.0"
- rvm: 2.7.1
env: DIFF_LCS_VERSION="1.4.3"
allow_failures:
- rvm: jruby-head
- rvm: ruby-head
Expand All @@ -50,3 +43,4 @@ branches:
only:
- main
- /^\d+-\d+-maintenance$/
- /^\d+-\d+-dev$/
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

version: "{build}"
Expand Down
73 changes: 73 additions & 0 deletions script/ci_functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

# Taken from:
# https://github.com/travis-ci/travis-build/blob/e9314616e182a23e6a280199cd9070bfc7cae548/lib/travis/build/script/templates/header.sh#L34-L53
travis_retry() {
local result=0
local count=1
while [ $count -le 3 ]; do
[ $result -ne 0 ] && {
echo -e "\n\033[33;1mThe command \"$@\" failed. Retrying, $count of 3.\033[0m\n" >&2
}
"$@"
result=$?
[ $result -eq 0 ] && break
count=$(($count + 1))
sleep 1
done

[ $count -eq 3 ] && {
echo "\n\033[33;1mThe command \"$@\" failed 3 times.\033[0m\n" >&2
}

return $result
}

# Taken from https://github.com/vcr/vcr/commit/fa96819c92b783ec0c794f788183e170e4f684b2
# and https://github.com/vcr/vcr/commit/040aaac5370c68cd13c847c076749cd547a6f9b1
nano_cmd="$(type -p gdate date | head -1)"
nano_format="+%s%N"
[ "$(uname -s)" != "Darwin" ] || nano_format="${nano_format/%N/000000000}"

travis_time_start() {
travis_timer_id=$(printf %08x $(( RANDOM * RANDOM )))
travis_start_time=$($nano_cmd -u "$nano_format")
printf "travis_time:start:%s\r\e[0m" $travis_timer_id
}

travis_time_finish() {
local travis_end_time=$($nano_cmd -u "$nano_format")
local duration=$(($travis_end_time-$travis_start_time))
printf "travis_time:end:%s:start=%s,finish=%s,duration=%s\r\e[0m" \
$travis_timer_id $travis_start_time $travis_end_time $duration
}

fold() {
local name="$1"
local status=0
shift 1
if [ -n "$TRAVIS" ]; then
printf "travis_fold:start:%s\r\e[0m" "$name"
travis_time_start
else
echo "============= Starting $name ==============="
fi

"$@"
status=$?

[ -z "$TRAVIS" ] || travis_time_finish

if [ "$status" -eq 0 ]; then
if [ -n "$TRAVIS" ]; then
printf "travis_fold:end:%s\r\e[0m" "$name"
else
echo "============= Ending $name ==============="
fi
else
STATUS="$status"
fi

return $status
}
2 changes: 1 addition & 1 deletion script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
Expand Down
4 changes: 2 additions & 2 deletions script/functions.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/travis_functions.sh
source $SCRIPT_DIR/ci_functions.sh
source $SCRIPT_DIR/predicate_functions.sh

# If JRUBY_OPTS isn't set, use these.
Expand Down
2 changes: 1 addition & 1 deletion script/predicate_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

function is_mri {
Expand Down
2 changes: 1 addition & 1 deletion script/run_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
Expand Down
2 changes: 1 addition & 1 deletion script/update_rubygems_and_install_bundler
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2020-09-28T16:30:00+02:00 from the rspec-dev repo.
# This file was generated on 2020-11-16T08:49:45+00:00 from the rspec-dev repo.
# DO NOT modify it by hand as your changes will get lost the next time it is generated.

set -e
Expand Down

0 comments on commit f86de8d

Please sign in to comment.