@@ -19,11 +19,9 @@ permissions:
1919 contents : read
2020
2121jobs :
22- native_setup :
23- name : " Setup "
22+ build_source_gem :
23+ name : " source gem "
2424 runs-on : ubuntu-latest
25- outputs :
26- rcd_image_version : ${{ steps.rcd_image_version.outputs.rcd_image_version }}
2725 steps :
2826 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2927 with :
@@ -33,12 +31,23 @@ jobs:
3331 with :
3432 ruby-version : " 3.4"
3533 bundler-cache : true
36- - id : rcd_image_version
37- run : bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> "$GITHUB_OUTPUT"
34+ - name : Build source gem
35+ run : |
36+ # shellcheck disable=SC2086 # RELEASE_FLAG intentionally word-splits (empty or "--release")
37+ ./bin/test-gem-build ${RELEASE_FLAG} gems ruby
38+ env :
39+ RELEASE_FLAG : ${{ inputs.release && '--release' || '' }}
40+ - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
41+ with :
42+ name : " ${{ inputs.artifact_prefix }}source-gem"
43+ path : gems
44+ retention-days : 1
3845
39- build_source_gem :
40- name : " build source "
46+ build_native_setup :
47+ name : " setup "
4148 runs-on : ubuntu-latest
49+ outputs :
50+ rcd_image_version : ${{ steps.rcd_image_version.outputs.rcd_image_version }}
4251 steps :
4352 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4453 with :
@@ -48,20 +57,12 @@ jobs:
4857 with :
4958 ruby-version : " 3.4"
5059 bundler-cache : true
51- - run : |
52- # shellcheck disable=SC2086 # RELEASE_FLAG intentionally word-splits (empty or "--release")
53- ./bin/test-gem-build ${RELEASE_FLAG} gems ruby
54- env:
55- RELEASE_FLAG: ${{ inputs.release && '--release' || '' }}
56- - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
57- with :
58- name : " ${{ inputs.artifact_prefix }}source-gem"
59- path : gems
60- retention-days : 1
60+ - id : rcd_image_version
61+ run : bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> "$GITHUB_OUTPUT"
6162
6263 build_native_gem :
63- needs : native_setup
64- name : " build native ${{ matrix.platform }}"
64+ needs : build_native_setup
65+ name : " native gem ${{ matrix.platform }}"
6566 strategy :
6667 # CI runs want to surface every platform's failure (fail-fast: false);
6768 # release runs should stop on first failure to avoid pushing a partial
@@ -85,13 +86,14 @@ jobs:
8586 with :
8687 ref : ${{ inputs.ref || github.ref }}
8788 persist-credentials : false
88- - run : |
89+ - name : Build native gem
90+ run : |
8991 # shellcheck disable=SC2086 # RELEASE_FLAG intentionally word-splits (empty or "--release")
9092 docker run --rm -v "$PWD:/work" -w /work \
9193 "ghcr.io/rake-compiler/rake-compiler-dock-image:${RCD_IMAGE_VERSION}-mri-${PLATFORM}" \
9294 ./bin/test-gem-build ${RELEASE_FLAG} gems "${PLATFORM}"
9395 env :
94- RCD_IMAGE_VERSION: ${{ needs.native_setup .outputs.rcd_image_version }}
96+ RCD_IMAGE_VERSION : ${{ needs.build_native_setup .outputs.rcd_image_version }}
9597 RELEASE_FLAG : ${{ inputs.release && '--release' || '' }}
9698 PLATFORM : ${{ matrix.platform }}
9799 - uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
0 commit comments