Skip to content

Commit 4ac8b12

Browse files
committed
CI: Add make-ibm job in ubuntu.yml and remove ubuntu-ibm.yml
Add `make-ibm` job to run ppc64le/s390x cases in the `ubuntu.yml`, and remove `ubuntu-ibm.yml`. This commit improves removing a duplicated logic between the `ubuntu.yml` and `ubuntu-ibm.yml`. I am using the YAML anchors and aliases feature to avoid the duplicated logic. The document is below. https://docs.github.com/en/actions/reference/workflows-and-actions/reusing-workflow-configurations#yaml-anchors-and-aliases I don't add the `make-ibm` job to the `result` job, the line `needs: [make]` intentionally to make the `make-ibm` job's result optional to merge PRs.
1 parent ba52af6 commit 4ac8b12

File tree

2 files changed

+55
-186
lines changed

2 files changed

+55
-186
lines changed

.github/workflows/ubuntu-ibm.yml

Lines changed: 0 additions & 183 deletions
This file was deleted.

.github/workflows/ubuntu.yml

Lines changed: 55 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
extra_checks: [capi]
4646
fail-fast: false
4747

48-
env:
48+
env: &make-env
4949
GITPULLOPTIONS: --no-tags origin ${{ github.ref }}
5050
RUBY_DEBUG: ci
5151

@@ -59,7 +59,7 @@ jobs:
5959
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
6060
)}}
6161
62-
steps:
62+
steps: &make-steps
6363
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6464
with:
6565
sparse-checkout-cone-mode: false
@@ -73,7 +73,19 @@ jobs:
7373
with:
7474
ruby-version: '3.1'
7575
bundler: none
76-
if: ${{ !endsWith(matrix.os, 'arm') }}
76+
if: >-
77+
${{ !endsWith(matrix.os, 'arm')
78+
&& !endsWith(matrix.os, 'ppc64le') && !endsWith(matrix.os, 's390x') }}
79+
80+
# A temporary workaround: Set HOME env to pass the step
81+
# ./.github/actions/setup/directories.
82+
# https://github.com/IBM/actionspz/issues/30
83+
- name: Set HOME env
84+
run: |
85+
echo "HOME: ${HOME}"
86+
echo "HOME=$(ls -d ~)" >> $GITHUB_ENV
87+
working-directory:
88+
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}
7789

7890
- uses: ./.github/actions/setup/directories
7991
with:
@@ -123,6 +135,21 @@ jobs:
123135
continue-on-error: true
124136
timeout-minutes: 3
125137

138+
# Avoid possible test failures with the zlib applying the following patch
139+
# on s390x CPU architecture.
140+
# https://github.com/madler/zlib/pull/410
141+
- name: Disable DFLTCC
142+
run: echo "DFLTCC=0" >> $GITHUB_ENV
143+
if: ${{ endsWith(matrix.os, 's390x') }}
144+
145+
# A temporary workaround: Set the user's primary group to avoid a mismatch
146+
# between the group IDs of "id -g" and C function getpwuid(uid_t uid)
147+
# pw_gid.
148+
# https://github.com/IBM/actionspz/issues/31
149+
- name: Set user's group id
150+
run: sudo usermod -g "$(id -g)" runner
151+
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}
152+
126153
- name: make ${{ matrix.test_task }}
127154
run: |
128155
test -n "${LAUNCHABLE_STDOUT}" && exec 1> >(tee "${LAUNCHABLE_STDOUT}")
@@ -168,6 +195,31 @@ jobs:
168195
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
169196
if: ${{ failure() }}
170197

198+
make-ibm:
199+
strategy:
200+
matrix:
201+
include:
202+
- test_task: check
203+
os: ubuntu-24.04-ppc64le
204+
- test_task: check
205+
os: ubuntu-24.04-s390x
206+
fail-fast: false
207+
208+
env: *make-env
209+
210+
runs-on: ${{ matrix.os }}
211+
212+
if: >-
213+
${{github.repository == 'ruby/ruby'
214+
&& !(false
215+
|| contains(github.event.head_commit.message, '[DOC]')
216+
|| contains(github.event.pull_request.title, '[DOC]')
217+
|| contains(github.event.pull_request.labels.*.name, 'Documentation')
218+
|| (github.event_name == 'push' && github.event.pull_request.user.login == 'dependabot[bot]')
219+
)}}
220+
221+
steps: *make-steps
222+
171223
result:
172224
if: ${{ always() }}
173225
name: ${{ github.workflow }} result

0 commit comments

Comments
 (0)