Save CAPI extensions cache not-cached master only

This commit is contained in:
Nobuyoshi Nakada 2025-09-14 20:57:56 +09:00
parent 214ba4074d
commit c4ac3e987b
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465

View File

@ -35,8 +35,8 @@ runs:
echo DLEXT=$DLEXT >> $GITHUB_OUTPUT
working-directory: ${{ inputs.builddir }}
- name: CAPI extensions cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
- name: Restore previous CAPI extensions
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
id: cache
with:
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
@ -50,11 +50,24 @@ runs:
touch spec/ruby/optional/capi/ext/*.$DLEXT
[ ! -f spec/ruby/optional/capi/ext/\*.$DLEXT ]
${{ inputs.make }} SPECOPTS=optional/capi test-spec
rm -f spec/ruby/optional/capi/ext/*.c
env:
DLEXT: ${{ steps.config.outputs.DLEXT }}
working-directory: ${{ inputs.builddir }}
if: ${{ steps.cache.outputs.cache-hit }}
- name: Save CAPI extensions
uses: actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
key: ${{ steps.config.outputs.key }}
if: >-
${{true
&& steps.cache.outcome == 'success'
&& ! steps.cache.outputs.cache-hit
&& github.ref_name == 'master'
}}
- shell: bash
run: |
echo "::error::Change from ${prev} detected; bump up ABI version"