Skip to content

Commit 5f4d810

Browse files
author
Willem Homan
committed
ci(platform): PAYMENTS-12054 Key the bundler cache on the Gemfile, since there is no lockfile
1 parent 59df7c8 commit 5f4d810

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎.circleci/config.yml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,38 @@ orbs:
44
ci: bigcommerce/internal@volatile
55
ruby: bigcommerce/internal-ruby@volatile
66

7+
# The orb builds its bundler cache key as `<cache_key>-{{ arch }}-{{ checksum <checksumfile> }}` and defaults
8+
# checksumfile to Gemfile.lock. This repo ships no lockfile, deliberately, so that key cannot be computed:
9+
# `restore_cache` fails outright and every job installs its gems cold. The failure does not fail the job, so builds stay
10+
# green and the cost goes unnoticed.
11+
#
12+
# The Gemfile is the stable file that does exist. It pins nothing, so the cache is only a warm vendor/bundle to start
13+
# from and bundler still resolves fresh on every run, which is what a gem wants: CI is the only place a breaking
14+
# upstream release gets caught.
715
defaults: &defaults
816
notify_failure: false
17+
checksumfile: Gemfile
918

19+
# cache_key varies per ruby because `{{ arch }}` is OS and CPU, not ruby version. A single bucket shared across 3.3, 3.4
20+
# and 4.0 would have each job save over the others, and native extensions built against one ruby ABI are not loadable
21+
# by another.
1022
ruby_3_3_defaults: &ruby_3_3_defaults
1123
<<: *defaults
24+
cache_key: gem-cache-ruby-3_3
1225
e:
1326
name: ruby/ruby
1427
ruby-version: '3.3'
1528

1629
ruby_3_4_defaults: &ruby_3_4_defaults
1730
<<: *defaults
31+
cache_key: gem-cache-ruby-3_4
1832
e:
1933
name: ruby/ruby
2034
ruby-version: '3.4'
2135

2236
ruby_4_0_defaults: &ruby_4_0_defaults
2337
<<: *defaults
38+
cache_key: gem-cache-ruby-4_0
2439
e:
2540
name: ruby/ruby
2641
ruby-version: '4.0'

0 commit comments

Comments
 (0)