blob: 49562725f46782f9d74f586acbd069f89b517c19 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
name: rubyspec C-API extensions
inputs:
builddir:
required: false
default: '.'
make:
required: false
default: 'make -s'
outputs:
key:
value: >-
${{
!steps.restore.outputs.cache-hit &&
github.ref == 'refs/heads/master' &&
steps.config.outputs.key
}}
runs:
using: composite
steps:
- id: config
shell: bash
run: |
eval $(grep -e '^arch *=' -e '^ruby_version *=' -e '^DLEXT *=' Makefile |
sed 's/ *= */=/')
case "${ruby_version}" in
*+*) key=capiexts-${arch}-${ruby_version}-${{ hashFiles('src/spec/ruby/optional/capi/ext/*.[ch]') }};;
*) key=;;
esac
echo version=$ruby_version >> $GITHUB_OUTPUT
echo key="$key" >> $GITHUB_OUTPUT
echo DLEXT=$DLEXT >> $GITHUB_OUTPUT
working-directory: ${{ inputs.builddir }}
- name: Restore previous CAPI extensions
uses: actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
id: cache
with:
path: ${{ inputs.builddir }}/spec/ruby/optional/capi/ext/
key: ${{ steps.config.outputs.key }}
if: ${{ steps.config.outputs.key }}
- name: Run test-spec with previous CAPI extension binaries
id: check
shell: bash
run: |
touch spec/ruby/optional/capi/ext/*.$DLEXT
[ ! -f spec/ruby/optional/capi/ext/\*.$DLEXT ]
${{ inputs.make }} SPECOPTS=optional/capi test-spec
env:
DLEXT: ${{ steps.config.outputs.DLEXT }}
working-directory: ${{ inputs.builddir }}
if: ${{ steps.cache.outputs.cache-hit }}
- name: Strip CAPI extensions
id: strip
shell: bash
run: |
rm -f spec/ruby/optional/capi/ext/*.c
[ "$DLEXT" = bundle ] || # separated to .dSYM directories
strip spec/ruby/optional/capi/ext/*.$DLEXT
env:
DLEXT: ${{ steps.config.outputs.DLEXT }}
working-directory: ${{ inputs.builddir }}
if: >-
${{true
&& ! steps.cache.outputs.cache-hit
&& github.ref_name == 'master'
}}
- 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: ${{ steps.strip.outcome == 'success' }}
- shell: bash
run: |
echo "::error::Change from ${prev} detected; bump up ABI version"
env:
prev: ${{ steps.config.outputs.version }}
if: ${{ always() && steps.check.outcome == 'failure' }}
|