diff --git a/.github/actions/capiext/action.yml b/.github/actions/capiext/action.yml index a41202c7a4..c17069f97d 100644 --- a/.github/actions/capiext/action.yml +++ b/.github/actions/capiext/action.yml @@ -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"