-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/8.4-zts' of https://github.com/Endava/docker-php …
…into release/8.4-zts
- Loading branch information
Showing
1 changed file
with
44 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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] | ||
|
@@ -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 | ||
|