Skip to content

Apache DataFusion SQL Query Engine

ARROW-11234: [CI][Ruby][macOS] Reduce CI time

Sutou Kouheib3f1e8b51c5d
diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index f2ee60fbea..03f4f0eb0d 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -126,7 +126,7 @@ jobs:
- name: Fetch Submodules and Tags
shell: bash
run: ci/scripts/util_checkout.sh
- - name: Install Dependencies
+ - name: Install Homebrew Dependencies
shell: bash
run: |
rm -f /usr/local/bin/2to3
@@ -134,15 +134,32 @@ jobs:
brew unlink gcc@8 gcc@9
brew bundle --file=cpp/Brewfile
brew bundle --file=c_glib/Brewfile
+ - name: Install Ruby Dependencies
+ run: |
+ export MAKEFLAGS="-j$(sysctl -n hw.ncpu)"
bundle install --gemfile c_glib/Gemfile
bundle install --gemfile ruby/Gemfile
for ruby_package_gemfile in ruby/*/Gemfile; do \
bundle install --gemfile ${ruby_package_gemfile}
done
- - name: Build
- shell: bash
+ - name: Setup ccache
+ run: |
+ ci/scripts/ccache_setup.sh
+ - name: ccache info
+ id: ccache-info
+ run: |
+ echo "::set-output name=cache-dir::$(ccache --get-config cache_dir)"
+ - name: Cache ccache
+ uses: actions/cache@v2
+ with:
+ path: ${{ steps.ccache-info.outputs.cache-dir }}
+ key: ruby-ccache-macos-${{ hashFiles('cpp/**') }}
+ restore-keys: ruby-ccache-macos-
+ - name: Build C++
run: |
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
+ - name: Build GLib
+ run: |
ci/scripts/c_glib_build.sh $(pwd) $(pwd)/build
- name: Test GLib
shell: bash
diff --git a/ci/scripts/ccache_setup.sh b/ci/scripts/ccache_setup.sh
new file mode 100755
index 0000000000..f77fbb3736
--- /dev/null
+++ b/ci/scripts/ccache_setup.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -eux
+
+echo "ARROW_USE_CCACHE=ON" >> $GITHUB_ENV
+echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV
+echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
+echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
+echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV
diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.sh
index 793c5bf3f2..3f451e96b8 100755
--- a/ci/scripts/msys2_setup.sh
+++ b/ci/scripts/msys2_setup.sh
@@ -64,9 +64,5 @@ pacman \
--sync \
"${packages[@]}"
-echo "ARROW_USE_CCACHE=ON" >> $GITHUB_ENV
-echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV
-echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
-echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
-echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV
+"$(dirname $0)/ccache_setup.sh"
echo "CCACHE_DIR=$(cygpath --absolute --windows ccache)" >> $GITHUB_ENV