Commit c079e04e authored by Rémy Coutable's avatar Rémy Coutable

ci: Introduce a cache for Gitaly binaries

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a26b5814
...@@ -36,6 +36,27 @@ ...@@ -36,6 +36,27 @@
<<: *gitaly-ruby-gems-cache <<: *gitaly-ruby-gems-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up. policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
.gitaly-binaries-cache: &gitaly-binaries-cache
key:
files:
- GITALY_SERVER_VERSION
prefix: "gitaly-binaries"
paths:
- tmp/tests/gitaly/_build/bin/
- tmp/tests/gitaly/config.toml
- tmp/tests/gitaly/gitaly2.config.toml
- tmp/tests/gitaly/internal/
- tmp/tests/gitaly/internal_gitaly2/
- tmp/tests/gitaly/internal_sockets/
- tmp/tests/gitaly/Makefile
- tmp/tests/gitaly/praefect.config.toml
- tmp/tests/gitaly/ruby/
policy: pull
.gitaly-binaries-cache-push: &gitaly-binaries-cache-push
<<: *gitaly-binaries-cache
policy: push # We want to rebuild the cache from scratch to ensure stale dependencies are cleaned up.
.go-pkg-cache: &go-pkg-cache .go-pkg-cache: &go-pkg-cache
key: "go-pkg-v1" key: "go-pkg-v1"
paths: paths:
...@@ -97,12 +118,14 @@ ...@@ -97,12 +118,14 @@
cache: cache:
- *ruby-gems-cache - *ruby-gems-cache
- *gitaly-ruby-gems-cache - *gitaly-ruby-gems-cache
- *gitaly-binaries-cache
- *go-pkg-cache - *go-pkg-cache
.setup-test-env-cache-push: .setup-test-env-cache-push:
cache: cache:
- *ruby-gems-cache-push - *ruby-gems-cache-push
- *gitaly-ruby-gems-cache-push - *gitaly-ruby-gems-cache-push
- *gitaly-binaries-cache-push
- *go-pkg-cache-push - *go-pkg-cache-push
.rails-cache: .rails-cache:
......
...@@ -15,7 +15,12 @@ class GitalyTestBuild ...@@ -15,7 +15,12 @@ class GitalyTestBuild
def run def run
set_bundler_config set_bundler_config
# If we have the binaries from the cache, we can skip building them again
if File.exist?(tmp_tests_gitaly_bin_dir)
GitalySetup::LOGGER.debug "Gitaly binary already built. Skip building...\n"
else
abort 'gitaly build failed' unless build_gitaly abort 'gitaly build failed' unless build_gitaly
end
ensure_gitlab_shell_secret! ensure_gitlab_shell_secret!
check_gitaly_config! check_gitaly_config!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment