Skip to content

Commit

Permalink
Use less specific cache keys
Browse files Browse the repository at this point in the history
  • Loading branch information
pointlessone committed Feb 23, 2023
1 parent 7c8285a commit b60a52d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/gems
key: gems-3.2-${{ hashFiles('*.gemspec', 'Gemfile') }}-${{ github.sha }}
key: gems-3.2-${{ hashFiles('*.gemspec', 'Gemfile') }}

This comment has been minimized.

Copy link
@tindron

tindron Feb 28, 2023

If you add bundler-cache: true to setup-ruby's with section it will handle the gem cache and install dependencies steps for you. https://github.com/ruby/setup-ruby#caching-bundle-install-automatically

This comment has been minimized.

Copy link
@pointlessone

pointlessone Feb 28, 2023

Author Member

It will also plop all the gem inside the project directory. It interferes with prawn set up. Namely, default RuboCop configuration to scan all ruby files. Of all the directories one could use they've chosen the most invasive one. setup-ruby's authors decided not to make it configurable. I respect their choice but refuse to adopt it.

Thank you for reviewing the PR, though.

This comment has been minimized.

Copy link
@tindron

tindron Feb 28, 2023

Doesn't it use the vendor directory that is excluded by the default rubocop config? https://github.com/rubocop/rubocop/blob/master/config/default.yml#L66

restore-keys: |
gems-3.2-${{ hashFiles('*.gemspec', 'Gemfile') }}-
gems-3.2-
- name: Install dependencies
run: |
Expand Down Expand Up @@ -59,9 +58,8 @@ jobs:
uses: actions/cache@v3
with:
path: ~/gems
key: gems-${{ matrix.ruby }}-${{ hashFiles('*.gemspec', 'Gemfile') }}-${{ github.sha }}
key: gems-${{ matrix.ruby }}-${{ hashFiles('*.gemspec', 'Gemfile') }}
restore-keys: |
gems-${{ matrix.ruby }}-${{ hashFiles('*.gemspec', 'Gemfile') }}-
gems-${{ matrix.ruby }}-
- name: Install dependencies
run: |
Expand Down

0 comments on commit b60a52d

Please sign in to comment.