Skip to content

Commit c4ac3e9

Browse files
committed
Save CAPI extensions cache not-cached master only
1 parent 214ba40 commit c4ac3e9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/actions/capiext/action.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ runs:
3535
echo DLEXT=$DLEXT >> $GITHUB_OUTPUT
3636
working-directory: ${{ inputs.builddir }}
3737

38-
- name: CAPI extensions cache
39-
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
38+
- name: Restore previous CAPI extensions
39+
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
4040
id: cache
4141
with:
4242
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
@@ -50,11 +50,24 @@ runs:
5050
touch spec/ruby/optional/capi/ext/*.$DLEXT
5151
[ ! -f spec/ruby/optional/capi/ext/\*.$DLEXT ]
5252
${{ inputs.make }} SPECOPTS=optional/capi test-spec
53+
rm -f spec/ruby/optional/capi/ext/*.c
5354
env:
5455
DLEXT: ${{ steps.config.outputs.DLEXT }}
5556
working-directory: ${{ inputs.builddir }}
5657
if: ${{ steps.cache.outputs.cache-hit }}
5758

59+
- name: Save CAPI extensions
60+
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
61+
with:
62+
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
63+
key: ${{ steps.config.outputs.key }}
64+
if: >-
65+
${{true
66+
&& steps.cache.outcome == 'success'
67+
&& ! steps.cache.outputs.cache-hit
68+
&& github.ref_name == 'master'
69+
}}
70+
5871
- shell: bash
5972
run: |
6073
echo "::error::Change from ${prev} detected; bump up ABI version"

0 commit comments

Comments
 (0)