Skip to content

CI: ubuntu.yml: Migrate Travis CI ppc64le/s390x cases to GitHub Actions. #13972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

junaruga
Copy link
Member

@junaruga junaruga commented Jul 22, 2025

/cc @hsbt

Add the ubuntu-22.04-ppc64le and ubuntu-22.04-s390x to align the following
hosts running Ubuntu 22.04 on Ruby CI.

https://rubyci.org/

  • ppc64le (Ubuntu)
  • s390x (Ubuntu)

These GitHub Actions ppc64le/s390x pipelines are managed by the following project.
https://github.com/IBM/actionspz

The onboarding document is below.
https://github.com/IBM/actionspz/blob/main/docs/onboarding.md

This PR is related to IBM/actionspz#4.

@junaruga junaruga force-pushed the wip/gha-ppc64le-s390x branch 3 times, most recently from 0b2778a to 8b2a6ab Compare July 22, 2025 15:50
@junaruga
Copy link
Member Author

I got the following error that HOME environment variable is not set.

https://github.com/ruby/ruby/actions/runs/16448587964/job/46487337166

$ git config --global core.autocrlf false
fatal: $HOME not set
Error: Process completed with exit code 128.

So, I added the following hack to set the HOME environment variable.

      # This is a temporary workaround to set HOME env to pass the next step
      # ./.github/actions/setup/directories.
      - name: Set HOME env
        run: |
          echo "HOME: #{HOME}"
          pushd ~
          echo "HOME=$(pwd)" >> $GITHUB_ENV
          popd
        if: ${{ endsWith(matrix.os, 'ppc64le') || endsWith(matrix.os, 's390x') }}

However, it seems the directory by the ~ doesn't exsit.

https://github.com/ruby/ruby/actions/runs/16449252485/job/46489719903?pr=13972

Error: An error occurred trying to start process '/usr/bin/bash' with working directory '/tmp/_actions-runner-working-dir/ruby/ruby/build'. No such file or directory

@junaruga junaruga force-pushed the wip/gha-ppc64le-s390x branch from 5d4c700 to 4f5d070 Compare July 23, 2025 14:44
@junaruga junaruga changed the title CI: ubuntu.yml: Add ppc64le/s390x cases. CI: ubuntu.yml: Migrate Travis CI ppc64le/s390x cases to GitHub Actions. Jul 23, 2025
@junaruga junaruga force-pushed the wip/gha-ppc64le-s390x branch 3 times, most recently from 54736bd to df5600d Compare July 23, 2025 15:05
Add the ppc64le/s390x cases using GitHub Actions ppc64le/s390x service.
https://github.com/IBM/actionspz

We can run the job only in the registered upstream repositories.
https://github.com/IBM/actionspz/blob/main/docs/FAQ.md#what-about-forked-repos

While Travis CI ran the Ubuntu 22.04 jammy ppc64le and s390x cases, and Ruby CI
<https://rubyci.org/>'s "ppc64le (Ubuntu)" and "s390x (Ubuntu)" servers are
also Ubuntu 22.04 cases, this commit adds the Ubuntu 24.04 cases using the
following images. Because there is a merit to having both Ubuntu 24.04 and
22.04 cases to test Ruby in various environments.

* ubuntu-24.04-ppc64le
* ubuntu-24.04-s390x

Note the following images are also available.

* ubuntu-22.04-ppc64le
* ubuntu-22.04-s390x
@junaruga junaruga force-pushed the wip/gha-ppc64le-s390x branch from df5600d to 625ab72 Compare July 23, 2025 15:19
@junaruga
Copy link
Member Author

@Earlopain, I am trying to skip ubuntu-24.04-ppc64le and ubuntu-24.04-s390x cases of the .github/workflows/ubuntu.yml in the matrix in forked repositories, still running the ubuntu-24.04-arm, using your way mentioned at the ruby/prism#3611 (comment).

https://github.com/ruby/ruby/pull/13972/files#diff-6640e8c668a6deeb426558faaa2b0f535d95814c09a05c044a1df27a008dd544

However, it seems all the cases are skipped in the current config file. Could you give me an advice to run the ppc64le/s390x as I intend? Thanks!

As a reference, the document of the matrix is below.

https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow

@junaruga junaruga mentioned this pull request Jul 23, 2025
2 tasks
@Earlopain
Copy link
Contributor

Unfortunatly excludes are run before includes so it doesn't work for this setup. But if you rewrite it a bit, it seems to work:

      matrix:
        os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-arm, ubuntu-24.04-ppc64le, ubuntu-24.04-s390x ]
        test_task: [check]
        configure: ['']
        arch: ['']
        timeout: [40]
        # The ppc64le/s390x runners works only in the registered repositories.
        # They don't work in forked repositories.
        # https://github.com/IBM/actionspz/blob/main/docs/FAQ.md#what-about-forked-repos
        upstream:
          - ${{ github.repository == 'ruby/ruby' }}
        include:
          - test_task: check
            configure: 'cppflags=-DVM_CHECK_MODE'
          - test_task: check
            arch: i686
          - test_task: check
            configure: '--disable-yjit'
          - test_task: check
            configure: '--enable-shared --enable-load-relative'
          - test_task: test-bundler-parallel
            timeout: 50
          - test_task: test-bundled-gems
        exclude:
          - os: ubuntu-24.04-ppc64le
            upstream: false
          - os: ubuntu-24.04-s390x
            upstream: false
      fail-fast: false

I think this is what you are looking for. I tested this in one of my repos and it does what I would expect it to. This is good as long as you only want to run the check task though. Anything more complicated runs into the previously mentioned limitation.

There are more general solutions to this by dynamically creating the test matrix in a previous job, writing that to an output, and then refering to that output in the job that needs the matrix. Basically what is happening here: https://github.com/ruby/actions/blob/master/.github/workflows/ruby_versions.yml. It's a bit more complicated though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy