From 92e6b48156ae029d96d2fac8c462b94138e4dab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 17 Jan 2025 19:12:31 +0100 Subject: [PATCH] ci: use the new ARM runners for ARM builds (#1333) --- .github/workflows/docker.yaml | 17 ++++------------- .github/workflows/static.yaml | 15 +++------------ 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 9835f5b75..0f63ac646 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -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 }} @@ -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) }} @@ -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 @@ -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: @@ -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}")" \ @@ -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 diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 0173a5590..c6880ba28 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -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 }} @@ -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 @@ -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: @@ -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