Skip to content

Commit

Permalink
ci: use the new ARM runners for ARM builds (#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas authored Jan 17, 2025
1 parent e53ba34 commit 92e6b48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ env:
IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }}
jobs:
prepare:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
# Push if it's a scheduled job, a tag, or if we're committing to the main branch
push: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request')) && true || false }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
VERSION: ${{ (github.ref_type == 'tag' && github.ref_name) || steps.check.outputs.ref || 'dev' }}
PHP_VERSION: ${{ steps.check.outputs.php_version }}
build:
runs-on: ubuntu-latest
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
needs:
- prepare
if: ${{ !fromJson(needs.prepare.outputs.skip) }}
Expand All @@ -111,12 +111,8 @@ jobs:
platform: ${{ fromJson(needs.prepare.outputs.platforms) }}
include:
- race: ""
qemu: true
- platform: linux/amd64
qemu: false
race: "-race" # The Go race detector is only supported on amd64
- platform: linux/386
qemu: false
exclude:
# arm/v6 is only available for Alpine: https://github.com/docker-library/golang/issues/502
- variant: php-${{ needs.prepare.outputs.php82_version }}-bookworm
Expand All @@ -132,11 +128,6 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.ref }}
- name: Set up QEMU
if: matrix.qemu
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand Down Expand Up @@ -202,7 +193,7 @@ jobs:
if-no-files-found: error
retention-days: 1
- name: Run tests
if: ${{ !matrix.qemu && !fromJson(needs.prepare.outputs.push) }}
if: ${{ !fromJson(needs.prepare.outputs.push) }}
run: |
docker run --platform=${{ matrix.platform }} --rm \
"$(jq -r '."builder-${{ matrix.variant }}"."containerimage.config.digest"' <<< "${METADATA}")" \
Expand All @@ -211,7 +202,7 @@ jobs:
METADATA: ${{ steps.build.outputs.metadata }}
# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/
push:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- prepare
- build
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ env:
IMAGE_NAME: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/')) && 'dunglas/frankenphp' || 'dunglas/frankenphp-dev' }}
jobs:
prepare:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
push: ${{ toJson((steps.check.outputs.ref || (github.event_name == 'workflow_dispatch' && inputs.version) || startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name != 'pull_request')) && true || false) }}
platforms: ${{ steps.matrix.outputs.platforms }}
Expand Down Expand Up @@ -74,17 +74,13 @@ jobs:
debug: [false]
mimalloc: [false]
include:
- qemu: true
- platform: linux/amd64
qemu: false
- platform: linux/amd64
qemu: false
debug: true
- platform: linux/amd64
qemu: false
mimalloc: true
name: Build ${{ matrix.platform }} static binary${{ matrix.debug && ' (debug)' || '' }}${{ matrix.mimalloc && ' (mimalloc)' || '' }}
runs-on: ubuntu-latest
runs-on: ${{ startsWith(matrix.platform, 'linux/arm') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
needs: [prepare]
steps:
- name: Prepare
Expand All @@ -95,11 +91,6 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ needs.prepare.outputs.ref }}
- name: Set up QEMU
if: matrix.qemu
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
Expand Down Expand Up @@ -187,7 +178,7 @@ jobs:

# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/
push:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- prepare
- build-linux
Expand Down

0 comments on commit 92e6b48

Please sign in to comment.