Add support for arm64 Linux and Windows GitHub hosted runners
Github released arm64 hosted runners
https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta
The install process goes slow then fails with this error
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/tools/add_tools.sh: line 31: /usr/bin/php: cannot execute binary file: Exec format error
Those are not supported by the action currently.
I will try to add support in future, but no promises until it only supports large runners.
Thank you for your response. They are configurable inside large runners section instead of a fixed default GitHub runs-on tag but already available to all customers on Team/Enterprise plans. Considering that these runners also cost 0.005€ instead of 0.008€ i think that many ppl will switch to them
@shivammathur are there any guide on how to implement a new runs-on platform? so i can help by submitting a PR
@LorenzoRogai It would require adding support for arm builds here https://github.com/shivammathur/php-builder for linux. On Windows php does not support arm as of now as there are no arm builds, so I'm not sure, will have to test if existing x64 builds work on Windows.
arm64 images have come out of public beta and are now in general availability https://github.blog/changelog/2024-09-03-github-actions-arm64-linux-and-windows-runners-are-now-generally-available/
We get a little further on our arm64 build (adding for googleibility):
Run shivammathur/setup-php@v2
/usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh
==> Setup PHP
✓ PHP Installed PHP 8.2.21
==> Setup Extensions
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line 13: /usr/bin/php: cannot execute binary file: Exec format error
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line 16: /usr/bin/php: cannot execute binary file: Exec format error
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line 16: /usr/bin/php: cannot execute binary file: Exec format error
Error: The operation was canceled.
Following up here, as we'd like to move to support them as well
At the end we just changed the workflow to use ppa:ondrej/php, if you have a simple PHP setup you can do this way. It worked fine anyway
@LorenzoRogai, chould you please share an example of how you did it?
@ihor-sviziev
Simply
- name: Add PHP PPA
run: sudo add-apt-repository ppa:ondrej/php
- name: Install PHP
run: |
sudo apt install \
php$(cat .php-version) \
php$(cat .php-version)-simplexml \
php$(cat .php-version)-curl \
php$(cat .php-version)-dom \
php$(cat .php-version)-xml \
php$(cat .php-version)-bcmath \
php$(cat .php-version)-zip \
php$(cat .php-version)-intl
This issue is also keeping us from using ARM in github actions
Would also be interested once ARM is supported
Now that we have support: https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/
Tracking the work required for this here
- [X] Add support in php-builder
- [x] Add builds in php-builder
- [x] Add support in php-ubuntu
- [x] Add builds in php-ubuntu
- [x] Add support in php5-ubuntu
- [x] Add builds in php5-ubuntu
- [x] Test using setup-php
It should work now. Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/12842826517/workflow
Added in https://github.com/shivammathur/php-builder/commit/792acf0effd942bfd414582d80ecc7e30e0b5acc, https://github.com/shivammathur/php-ubuntu/commit/d528fb9a5c1485fdd42cb3129a266d014b56279a and https://github.com/shivammathur/php5-ubuntu/commit/0dcff0821349a2a49579d40781cf612d19eedaec
Please report any issues you face.