Skip to content

Commit

Permalink
Merge branch 'release/8.4-zts' of https://github.com/Endava/docker-php
Browse files Browse the repository at this point in the history
…into release/8.4-zts
  • Loading branch information
en-jschuetze committed Jan 15, 2025
2 parents a966366 + 01b718b commit 82b9dd7
Showing 1 changed file with 44 additions and 26 deletions.
70 changes: 44 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
GITHUB_REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
RELEASE_REF_FILTER: 'refs/heads/release/'
EXCLUDED_PLATFORM: "linux/amd64" # change to linux/amd64
EXCLUDED_PLATFORM: "none" # change to linux/amd64
# and thos blocks from:
# exclude:
# - platform: none
Expand All @@ -34,17 +34,19 @@ jobs:
no-color: "true"
output-file: "/dev/stdout"
build-base:
runs-on: ARM64
runs-on: ${{ matrix.runs_on }}
needs:
- lint
strategy:
fail-fast: false
matrix:
platform:
- linux/arm64
- linux/amd64
exclude:
include:
- platform: linux/arm64
runs_on: ARM64
- platform: linux/amd64
runs_on: 'ubuntu-latest'
# exclude:
# - platform: none
steps:
-
name: Prepare
Expand Down Expand Up @@ -79,16 +81,18 @@ jobs:
name: ${{ env.PLATFORM_PAIR }}-base.tar
path: /tmp/${{ env.PLATFORM_PAIR }}-base.tar
build-pecl-modules:
runs-on: ARM64
runs-on: ${{ matrix.runs_on }}
needs: build-base
strategy:
fail-fast: false
matrix:
platform:
- linux/arm64
- linux/amd64
exclude:
include:
- platform: linux/arm64
runs_on: ARM64
- platform: linux/amd64
runs_on: 'ubuntu-latest'
#exclude:
# - platform: none
module:
- pecl-builder-amqp
- pecl-builder-apcu
Expand Down Expand Up @@ -137,16 +141,18 @@ jobs:
name: ${{ env.PLATFORM_PAIR }}-${{ matrix.module }}.tar
path: /tmp/${{ env.PLATFORM_PAIR }}-${{ matrix.module }}.tar
build-all:
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs_on }}
needs: build-pecl-modules
strategy:
fail-fast: false
matrix:
platform:
- linux/arm64
- linux/amd64
exclude:
include:
- platform: linux/arm64
runs_on: ARM64
- platform: linux/amd64
runs_on: 'ubuntu-latest'
#exclude:
# - platform: none
steps:
-
name: Prepare
Expand All @@ -163,14 +169,14 @@ jobs:
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- if: contains(github.ref, env.RELEASE_REF_FILTER)
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
Expand Down Expand Up @@ -207,16 +213,18 @@ jobs:
name: ${{ env.PLATFORM_PAIR }}.tar
path: /tmp/${{ env.PLATFORM_PAIR }}.tar
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs_on }}
needs: build-all
strategy:
fail-fast: false
matrix:
platform:
- linux/arm64
- linux/amd64
exclude:
include:
- platform: linux/arm64
runs_on: ARM64
- platform: linux/amd64
runs_on: 'ubuntu-latest'
#exclude:
# - platform: none
steps:
-
name: Prepare
Expand Down Expand Up @@ -257,6 +265,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download amd64 artifact
if: env.EXCLUDED_PLATFORM != 'linux/amd64'
uses: actions/download-artifact@v4
with:
name: linux-amd64.tar
Expand All @@ -277,14 +286,19 @@ jobs:
docker load --input /tmp/linux-amd64.tar
docker image ls -a
- name: Test amd64
if: env.EXCLUDED_PLATFORM != 'linux/amd64'
run: |
docker run --platform linux/amd64 --rm temporary-build-image-linux-amd64 sh -c 'uname -a && php -v'
- name: Test arm64
if: env.EXCLUDED_PLATFORM != 'linux/arm64'
run: |
docker run --platform linux/arm64 --rm temporary-build-image-linux-arm64 sh -c 'uname -a && php -v'
- name: "PHP_VERSION Env"
- name: "PHP_VERSION Env amd64"
if: env.EXCLUDED_PLATFORM != 'linux/amd64'
run: echo "PHP_VERSION=`docker run --pull=never --rm -t temporary-build-image-linux-amd64 php --version | head -n 1 | cut -f 2 -d ' '``docker run --pull=never --rm -t temporary-build-image-linux-amd64 php --version | grep 'ZTS' >/dev/null && echo '-zts' || echo ''`" >> $GITHUB_ENV
- name: "PHP_VERSION Env arm64"
if: env.EXCLUDED_PLATFORM != 'linux/arm64'
run: echo "PHP_VERSION=`docker run --pull=never --rm -t temporary-build-image-linux-arm64 php --version | head -n 1 | cut -f 2 -d ' '``docker run --pull=never --rm -t temporary-build-image-linux-arm64 php --version | grep 'ZTS' >/dev/null && echo '-zts' || echo ''`" >> $GITHUB_ENV
- name: Log into registry ${{ env.GITHUB_REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/[email protected]
Expand All @@ -305,7 +319,11 @@ jobs:
if [ "${{ env.EXCLUDED_PLATFORM }}" = "linux/arm64" ]; then
echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV
else
echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV
if [ "${{ env.EXCLUDED_PLATFORM }}" = "linux/amd64" ]; then
echo "PLATFORMS=linux/arm64" >> $GITHUB_ENV
else
echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV
fi
fi
- if: contains(matrix.suffix, 'unsuffixed')
name: Build and push Docker image
Expand Down

0 comments on commit 82b9dd7

Please sign in to comment.