As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit beb21702 authored by Patrick Bajao's avatar Patrick Bajao
Browse files

Split caching of go and ruby jobs

We experienced a flaky failure of pipeline on `main` due to
caching changes.

To prevent that, we split the cache jobs specific to go and ruby
and use them accordingly. We also set the policy to `pull-push` on
specific jobs that need to update the cache.
parent 3eaa4ebe
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -19,6 +19,7 @@ variables:
DEBIAN_VERSION: "bullseye"
RUBY_VERSION: "ruby-3.2"
BUNDLE_PATH: vendor/ruby
POLICY: pull
workflow:
rules: &workflow_rules
Loading
Loading
@@ -43,19 +44,24 @@ default:
- gitlab-org-docker
.cached-job:
.cached-go-job:
cache:
- key:
prefix: $GO_VERSION-cache
files:
- go.mod
- go.sum
policy: $POLICY
paths:
- .GOPATH/pkg/mod/
.cached-ruby-job:
cache:
- key:
prefix: $RUBY_VERSION-cache
files:
- Gemfile.lock
policy: $POLICY
paths:
- ${BUNDLE_PATH}
Loading
Loading
@@ -70,15 +76,19 @@ default:
bundle:install:
stage: prepare
extends: .cached-job
extends: .cached-ruby-job
variables:
POLICY: pull-push
script:
- bundle install --jobs $(nproc)
modules:download:
stage: prepare
extends:
- .cached-job
- .cached-go-job
- .go-matrix-job
variables:
POLICY: pull-push
script:
- go mod download
Loading
Loading
@@ -104,7 +114,8 @@ modules:download:
tests:
extends:
- .cached-job
- .cached-go-job
- .cached-ruby-job
- .go-matrix-job
- .test-job
script:
Loading
Loading
@@ -115,7 +126,7 @@ tests:
race:
extends:
- .cached-job
- .cached-go-job
- .go-matrix-job
- .test-job
script:
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment