@@ -9,15 +9,15 @@ inputs:
9
9
runs :
10
10
using : ' composite'
11
11
steps :
12
- - name : Cache Ruby
13
- id : ruby-cache
14
- uses : actions/cache@v4
12
+ - name : Restore cached Ruby installation
13
+ id : cache- ruby-restore
14
+ uses : actions/cache/restore @v4
15
15
with :
16
16
path : ~/rubies/ruby-${{ inputs.version }}
17
17
key : ruby-${{ inputs.version }}-${{ inputs.openssl-version }}
18
18
19
19
- name : Install Ruby
20
- if : steps.ruby-cache .outputs.cache-hit != 'true'
20
+ if : steps.cache- ruby-restore .outputs.cache-hit != 'true'
21
21
shell : bash
22
22
run : |
23
23
latest_patch=$(curl -s https://cache.ruby-lang.org/pub/ruby/${{ inputs.version }}/ \
@@ -48,17 +48,32 @@ runs:
48
48
echo "Don't know how to install Bundler for Ruby ${{ inputs.version }}"
49
49
;;
50
50
esac
51
+ - name : Save Ruby installation cache
52
+ id : cache-ruby-save
53
+ uses : actions/cache/save@v4
54
+ with :
55
+ path : ~/rubies/ruby-${{ inputs.version }}
56
+ key : ${{ steps.cache-ruby-restore.outputs.cache-primary-key }}
51
57
- name : Cache Bundler Install
52
- id : bundler-cache
53
- uses : actions/cache@v4
58
+ id : cache- bundler-restore
59
+ uses : actions/cache/restore @v4
54
60
env :
55
61
GEMFILE : ${{ env.BUNDLE_GEMFILE || 'Gemfile' }}
56
62
with :
57
63
path : ./vendor/bundle
58
64
key : bundler-ruby-${{ inputs.version }}-${{ inputs.openssl-version }}-${{ hashFiles(env.Gemfile, 'webauthn.gemspec') }}
59
65
60
66
- name : Install dependencies
67
+ if : steps.cache-bundler-restore.outputs.cache-hit != 'true'
61
68
shell : bash
62
69
run : |
63
70
bundle config set --local path ../vendor/bundle
64
71
bundle install
72
+
73
+ - name : Save Bundler Install cache
74
+ if : steps.cache-bundler-restore.outputs.cache-hit != 'true'
75
+ id : cache-bundler-save
76
+ uses : actions/cache/save@v4
77
+ with :
78
+ path : ./vendor/bundle
79
+ key : ${{ steps.cache-bundler-restore.outputs.cache-primary-key }}
0 commit comments