Skip to content

Commit

Permalink
Defer to built-in action caching (#1938)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
boardfish authored Aug 21, 2024
1 parent 9c77ec0 commit d090fb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,9 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- uses: actions/cache@v4
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-3.3-${{ hashFiles('**/Gemfile.lock') }}
bundler-cache: true
- name: Run benchmarks
run: |
bundle config path vendor/bundle
bundle update
bundle exec rake partial_benchmark
bundle exec rake translatable_benchmark
test:
Expand Down Expand Up @@ -103,24 +98,20 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
ruby-version: 3.3
bundler-cache: true
working-directory: 'view_component'
- uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/cache@v4
with:
path: |
node_modules
vendor/bundle
key: gems-build-pvc-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/package-json.lock') }}
cache: 'npm'
cache-dependency-path: 'primer_view_components/package-lock.json'
- name: Build and test with Rake
run: |
cd primer_view_components
npm ci
cd demo && npm ci && cd ..
bundle config path vendor/bundle
bundle install
bundle exec rake
bundle && bundle exec rake
env:
VIEW_COMPONENT_PATH: ../view_component
RAILS_VERSION: '7.1.1'
Expand All @@ -134,16 +125,9 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Download coverage results
uses: actions/download-artifact@v3
- uses: actions/cache@v4
with:
path: vendor/bundle
key: gems-build-rails-main-ruby-3.3-${{ hashFiles('**/Gemfile.lock') }}
- name: Collate simplecov
run: |
bundle config path vendor/bundle
bundle update
bundle exec rake coverage:report
env:
RAILS_VERSION: '~> 7.1.0'
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ nav_order: 5

## main

* Defer to built-in caching for language environment setup, rather than manually using `actions/cache` in CI.

*Simon Fish*

* Add test coverage for use of `turbo_stream` helpers in components when `capture_compatibility_patch_enabled` is `true`.

*Simon Fish*
Expand Down

0 comments on commit d090fb9

Please sign in to comment.