Skip to content

Commit d090fb9

Browse files
authored
Defer to built-in action caching (#1938)
* Defer to built-in action caching Closes #1937 * Lookup PVC package-lock * Setup Ruby in view_component directory * Manually bundle check again before we run rake * Update changelog * Default to Ruby 3.3 for actions * Remove version constraint for coverage Uses the Rails version specified in Gemfile.lock.
1 parent 9c77ec0 commit d090fb9

File tree

2 files changed

+12
-24
lines changed

2 files changed

+12
-24
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ jobs:
1515
uses: ruby/setup-ruby@v1
1616
with:
1717
ruby-version: 3.3
18-
- uses: actions/cache@v4
19-
with:
20-
path: vendor/bundle
21-
key: gems-build-rails-main-ruby-3.3-${{ hashFiles('**/Gemfile.lock') }}
18+
bundler-cache: true
2219
- name: Run benchmarks
2320
run: |
24-
bundle config path vendor/bundle
25-
bundle update
2621
bundle exec rake partial_benchmark
2722
bundle exec rake translatable_benchmark
2823
test:
@@ -103,24 +98,20 @@ jobs:
10398
- name: Setup Ruby
10499
uses: ruby/setup-ruby@v1
105100
with:
106-
ruby-version: 3.2
101+
ruby-version: 3.3
102+
bundler-cache: true
103+
working-directory: 'view_component'
107104
- uses: actions/setup-node@v4
108105
with:
109106
node-version: 16
110-
- uses: actions/cache@v4
111-
with:
112-
path: |
113-
node_modules
114-
vendor/bundle
115-
key: gems-build-pvc-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/package-json.lock') }}
107+
cache: 'npm'
108+
cache-dependency-path: 'primer_view_components/package-lock.json'
116109
- name: Build and test with Rake
117110
run: |
118111
cd primer_view_components
119112
npm ci
120113
cd demo && npm ci && cd ..
121-
bundle config path vendor/bundle
122-
bundle install
123-
bundle exec rake
114+
bundle && bundle exec rake
124115
env:
125116
VIEW_COMPONENT_PATH: ../view_component
126117
RAILS_VERSION: '7.1.1'
@@ -134,16 +125,9 @@ jobs:
134125
uses: ruby/setup-ruby@v1
135126
with:
136127
ruby-version: 3.3
128+
bundler-cache: true
137129
- name: Download coverage results
138130
uses: actions/download-artifact@v3
139-
- uses: actions/cache@v4
140-
with:
141-
path: vendor/bundle
142-
key: gems-build-rails-main-ruby-3.3-${{ hashFiles('**/Gemfile.lock') }}
143131
- name: Collate simplecov
144132
run: |
145-
bundle config path vendor/bundle
146-
bundle update
147133
bundle exec rake coverage:report
148-
env:
149-
RAILS_VERSION: '~> 7.1.0'

docs/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 5
1010

1111
## main
1212

13+
* Defer to built-in caching for language environment setup, rather than manually using `actions/cache` in CI.
14+
15+
*Simon Fish*
16+
1317
* Add test coverage for use of `turbo_stream` helpers in components when `capture_compatibility_patch_enabled` is `true`.
1418

1519
*Simon Fish*

0 commit comments

Comments
 (0)