[前][次][番号順一覧][スレッド一覧]

ruby-changes:56945

From: Takashi <ko1@a...>
Date: Mon, 12 Aug 2019 14:32:47 +0900 (JST)
Subject: [ruby-changes:56945] Takashi Kokubun: 4f10a61eaa (master): Stop relying on actions/checkout

https://git.ruby-lang.org/ruby.git/commit/?id=4f10a61eaa

From 4f10a61eaaf5bfe7e4c53edc79c5e27a7bd1ae33 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Mon, 12 Aug 2019 14:30:42 +0900
Subject: Stop relying on actions/checkout

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.

diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index 68fba08..629b542 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -21,10 +21,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/macos.yml#L21
         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)))
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index d7a6cba..7870fae 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -20,10 +20,8 @@ jobs: https://github.com/ruby/ruby/blob/trunk/.github/workflows/ubuntu.yml#L20
           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)))
diff --git a/.travis.yml b/.travis.yml
index 710bb4a..726b75b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -91,10 +91,10 @@ env: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L91
     #     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 \
@@ -119,9 +119,9 @@ env: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L119
         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 \
@@ -277,10 +277,10 @@ env: https://github.com/ruby/ruby/blob/trunk/.travis.yml#L277
     #     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 \
diff --git a/tool/ci_retry.sh b/tool/ci_retry.sh
new file mode 100755
index 0000000..4eb378a
--- /dev/null
+++ b/tool/ci_retry.sh
@@ -0,0 +1,15 @@ https://github.com/ruby/ruby/blob/trunk/tool/ci_retry.sh#L1
+#!/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"
+
+  echo "+ $@"
+  if "$@"; then
+    exit 0
+  fi
+done
+exit 1
diff --git a/tool/travis_retry.sh b/tool/travis_retry.sh
deleted file mode 100755
index 9b79c56..0000000
--- a/tool/travis_retry.sh
+++ /dev/null
@@ -1,13 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/tool/ci_retry.sh#L0
-#!/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
-
-for sleep in 0 ${WAITS:- 1 25 100}; do
-  sleep "$sleep"
-
-  echo "+ $@"
-  if "$@"; then
-    exit 0
-  fi
-done
-exit 1
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]