Skip to content

Commit

Permalink
Stop relying on actions/checkout
Browse files Browse the repository at this point in the history
because it randomly fails on authorization like:
https://github.com/ruby/ruby/runs/190887455
Also the backoff seems too short. Maybe we need tool/travis_retry.sh for
this too.

Cloning ruby/ruby does not need authorization. We don't need to use
actions/checkout.
  • Loading branch information
k0kubun committed Aug 12, 2019
1 parent 2b3d84d commit 4f10a61
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ jobs:
run: |
brew update
brew install gdbm gmp libffi openssl zlib ccache autoconf automake libtool readline
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 50
- name: Checkout # not using actions/checkout because it's unstable.
run: tool/ci_retry.sh git clone --depth=50 https://github.com/ruby/ruby .
- name: Set ENV
run: |
echo '##[set-env name=JOBS]'-j$((1 + $(sysctl -n hw.activecpu)))
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ jobs:
sudo apt-get update
sudo apt-get install ruby2.5
sudo apt-get build-dep ruby2.5
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 50
- name: Checkout # not using actions/checkout because it's unstable.
run: tool/ci_retry.sh git clone --depth=50 https://github.com/ruby/ruby .
- name: Set ENV
run: |
export JOBS=-j$((1 + $(nproc --all)))
Expand Down
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ env:
# sources:
# - ubuntu-toolchain-r-test
before_install:
- tool/travis_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- tool/travis_retry.sh bash -c "sudo rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && sudo apt-get update -yq"
- tool/ci_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- tool/ci_retry.sh bash -c "sudo rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && sudo apt-get update -yq"
- |-
tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
tool/ci_retry.sh sudo -E apt-get $travis_apt_get_options install \
gcc-8 \
libffi-dev \
libgdbm-dev \
Expand All @@ -119,9 +119,9 @@ env:
config:
retries: true
before_install:
- tool/travis_retry.sh bash -c "sudo rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && sudo apt-get update -yq"
- tool/ci_retry.sh bash -c "sudo rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && sudo apt-get update -yq"
- |-
tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
tool/ci_retry.sh sudo -E apt-get $travis_apt_get_options install \
clang-8 \
llvm-8-tools \
libffi-dev \
Expand Down Expand Up @@ -277,10 +277,10 @@ env:
# sources:
# - ubuntu-toolchain-r-test
before_install:
- tool/travis_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- tool/travis_retry.sh bash -c "sudo rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && sudo apt-get update -yq"
- tool/ci_retry.sh sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- tool/ci_retry.sh bash -c "sudo rm -rf '${TRAVIS_ROOT}/var/lib/apt/lists/'* && sudo apt-get update -yq"
- |-
tool/travis_retry.sh sudo -E apt-get $travis_apt_get_options install \
tool/ci_retry.sh sudo -E apt-get $travis_apt_get_options install \
gcc-8-multilib \
libffi-dev:i386 \
libffi6:i386 \
Expand Down
2 changes: 2 additions & 0 deletions tool/travis_retry.sh → tool/ci_retry.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh -eu
# The modified version of `travis_retry` to support custom backoffs, which is used by .travis.yml.
# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_retry.bash
#
# Now this is also used by .github/workflow/*.yml.

for sleep in 0 ${WAITS:- 1 25 100}; do
sleep "$sleep"
Expand Down

0 comments on commit 4f10a61

Please sign in to comment.