Skip to content

Commit

Permalink
ci: Github actions > use ubuntu arm runner
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Jan 18, 2025
1 parent 8e1fffb commit 64ca74d
Showing 1 changed file with 36 additions and 21 deletions.
57 changes: 36 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,33 @@ jobs:

examples:
runs-on: ${{ matrix.os }}
container: ${{ matrix.image || '' }}
needs:
- php-cs
strategy:
fail-fast: false
matrix:
php: [8.3]
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
os: [macos-13, macos-14, windows-latest]
include:
- os: ubuntu-latest
image:
- os: ubuntu-24.04-arm
image:
- os: ubuntu-latest
image: alpine
- os: ubuntu-24.04-arm
image: alpine
timeout-minutes: 5

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
name: Checkout repository

- name: Setup PHP (Alpine)
run: apk add --no-cache bash shared-mime-info php82-dev php82-ffi php82-pecl-grpc php82-sockets php82-tokenizer php82-dom php82-xml php82-xmlwriter php82-simplexml composer
if: matrix.image == 'alpine'

- name: Setup PHP
uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # v2
with:
Expand All @@ -61,6 +75,7 @@ jobs:
coverage: none
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: matrix.image == ''

- name: Composer install
uses: ramsey/composer-install@v3
Expand Down Expand Up @@ -131,23 +146,23 @@ jobs:
with:
parallel-finished: true

test-alpine:
runs-on: ubuntu-latest
needs:
- php-cs
strategy:
fail-fast: false
matrix:
arch: [ amd64, arm64 ]

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
name: Checkout repository
- name: Set up QEMU
if: matrix.arch == 'arm64'
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3
- name: Set up Docker Buildx
if: matrix.arch == 'arm64'
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
- name: run musl # If shared-mime-info not installed - Expected binary contents to have content type 'image/jpeg' but detected contents was 'application/octet-stream'
run: docker run --env PACT_DO_NOT_TRACK=true --platform=linux/${{ matrix.arch }} --rm -v $PWD:/home alpine:3.19 /bin/sh -c 'apk add --no-cache shared-mime-info php82-dev php82-ffi php82-pecl-grpc php82-sockets php82-tokenizer php82-dom php82-xml php82-xmlwriter php82-simplexml composer protoc protobuf-dev && cd /home && composer install && composer test && composer run-examples'
# test-alpine:
# runs-on: ubuntu-latest
# needs:
# - php-cs
# strategy:
# fail-fast: false
# matrix:
# arch: [ amd64, arm64 ]

# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# name: Checkout repository
# - name: Set up QEMU
# if: matrix.arch == 'arm64'
# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3
# - name: Set up Docker Buildx
# if: matrix.arch == 'arm64'
# uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
# - name: run musl # If shared-mime-info not installed - Expected binary contents to have content type 'image/jpeg' but detected contents was 'application/octet-stream'
# run: docker run --env PACT_DO_NOT_TRACK=true --platform=linux/${{ matrix.arch }} --rm -v $PWD:/home alpine:3.19 /bin/sh -c 'apk add --no-cache shared-mime-info php82-dev php82-ffi php82-pecl-grpc php82-sockets php82-tokenizer php82-dom php82-xml php82-xmlwriter php82-simplexml composer protoc protobuf-dev && cd /home && composer install && composer test && composer run-examples'

0 comments on commit 64ca74d

Please sign in to comment.