Skip to content

Commit 85fbc92

Browse files
committed
CI: Remove duplicated logic in host-ibm job
Remove logic in host-ibm job, which is duplicated from the host job. 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
1 parent e3dc030 commit 85fbc92

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,21 @@ jobs:
3939
- { os: windows-latest , ruby: debug }
4040
- { os: windows-latest , ruby: truffleruby }
4141

42-
steps:
42+
steps: &host-steps
4343
- uses: actions/checkout@v5
4444

4545
- name: Set up Ruby
4646
uses: ruby/setup-ruby@v1
4747
with:
4848
ruby-version: ${{ matrix.ruby }}
49+
if: ${{ !endsWith(matrix.os, 'ppc64le') && !endsWith(matrix.os, 's390x') }}
50+
51+
- name: Set up Ruby from deb package
52+
run: |
53+
sudo apt update
54+
sudo apt install ruby-full bundler
55+
sudo bundle install --jobs $(nproc)
56+
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}
4957

5058
- run: bundle install
5159

@@ -63,6 +71,10 @@ jobs:
6371
- run: ruby -Ilib test/run.rb
6472

6573
- run: rake install
74+
if: ${{ !endsWith(matrix.os, 'ppc64le') && !endsWith(matrix.os, 's390x') }}
75+
76+
- run: sudo rake install
77+
if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}
6678

6779
- name: Run test against installed gem
6880
# We can't use Fiddle gem with older RubyInstaller because
@@ -88,28 +100,7 @@ jobs:
88100
- ubuntu-24.04-ppc64le
89101
- ubuntu-24.04-s390x
90102

91-
steps:
92-
- uses: actions/checkout@v5
93-
94-
- name: Set up Ruby
95-
run: |
96-
sudo apt-get update
97-
sudo apt-get install ruby-full bundler libffi-dev
98-
99-
- run: sudo bundle install --jobs $(nproc)
100-
101-
- run: rake compile
102-
103-
- run: ruby -Ilib test/run.rb
104-
105-
- run: sudo rake install
106-
107-
- name: Run test against installed gem
108-
run: |
109-
ruby -run -e mkdir -- -p tmp/
110-
ruby -run -e cp -- -pr test/ tmp/
111-
cd tmp
112-
ruby test/run.rb
103+
steps: *host-steps
113104

114105
docker:
115106
name: >-

0 commit comments

Comments
 (0)