@@ -18,48 +18,42 @@ jobs:
18
18
variant : ['apache','cli','fpm']
19
19
runs-on : ubuntu-latest
20
20
steps :
21
+ - name : Checkout
22
+ uses : actions/checkout@v3
21
23
- name : Set up QEMU
22
- uses : docker/setup-qemu-action@v1
24
+ uses : docker/setup-qemu-action@v2
23
25
- name : Set up Docker Buildx
24
- uses : docker/setup-buildx-action@v1
25
- - name : Checkout
26
- uses : actions/checkout@v1
27
- # - name: Build locally
28
- # run: |
29
- # PHP_VERSION="${{ matrix.php_version }}"
30
- # docker buildx bake --load \
31
- # --set "*.platform=linux/amd64" \
32
- # php${PHP_VERSION//.}-slim-${{ matrix.variant }}
33
- # docker buildx bake --load \
34
- # --set "*.platform=linux/amd64" \
35
- # php${PHP_VERSION//.}-${{ matrix.variant }}-all
36
- # PHP_VERSION_MINOR=`docker run --rm thecodingmachine/php:${PHP_VERSION}-v4-slim-cli php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
37
- # echo "PHP_VERSION_MINOR=${PHP_VERSION_MINOR}" >> $GITHUB_ENV
38
- # echo "PHP Version : ${PHP_VERSION_MINOR}" >> $GITHUB_STEP_SUMMARY
39
- # docker images --filter=reference=thecodingmachine/php >> $GITHUB_STEP_SUMMARY
40
- # - name: Test ${{ matrix.variant }}
41
- # run: |
42
- # PHP_VERSION="${{ matrix.php_version }}" BRANCH=v4 VARIANT=${{ matrix.variant }} ./test-image.sh
43
- # echo "${{ matrix.variant }} variant OK" >> $GITHUB_STEP_SUMMARY
26
+ uses : docker/setup-buildx-action@v2
27
+ - name : Build locally (amd64)
28
+ run : |
29
+ PHP_VERSION="${{ matrix.php_version }}"
30
+ docker buildx bake --load \
31
+ --set "*.platform=linux/amd64" \
32
+ php${PHP_VERSION//.}-${{ matrix.variant }}-all
33
+ # Fetch minor version
34
+ PHP_VERSION_MINOR=`docker run --rm thecodingmachine/php:${PHP_VERSION}-v4-slim-${{ matrix.variant }} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
35
+ echo "PHP_VERSION_MINOR=${PHP_VERSION_MINOR}" >> $GITHUB_ENV
36
+ # Summary
37
+ echo "PHP Version : ${PHP_VERSION_MINOR}" >> $GITHUB_STEP_SUMMARY
38
+ docker images --filter=reference=thecodingmachine/php >> $GITHUB_STEP_SUMMARY
39
+ docker images --filter=reference=thecodingmachine/php
40
+ - name : Test variant '${{ matrix.variant }}' (amd64)
41
+ run : |
42
+ PHP_VERSION="${{ matrix.php_version }}" BRANCH=v4 VARIANT=${{ matrix.variant }} ./tests-suite/bash_unit -f tap ./tests-suite/*.sh
44
43
- name : Login to DockerHub
45
44
# Merge ~ push.
46
45
if : ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
47
46
uses : docker/login-action@v1
48
47
with :
49
48
username : ${{ secrets.DOCKERHUB_USERNAME }}
50
49
password : ${{ secrets.DOCKERHUB_TOKEN }}
51
- - name : Build and push to repository
50
+ - name : Build and push to repository (both amd64 and arm64)
52
51
# Merge ~ push.
53
52
if : ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
54
53
run : |
55
54
PHP_VERSION="${{ matrix.php_version }}"
56
- docker buildx bake \
57
- --set "*.platform=linux/amd64,linux/arm64" \
58
- --set "*.output=type=registry" \
59
- php${PHP_VERSION//.}-slim-${{ matrix.variant }}
60
- PHP_PATCH_MINOR=`docker run --rm thecodingmachine/php:${PHP_VERSION}-v4-slim-cli php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1` \
55
+ PHP_PATCH_MINOR="${{ env.PHP_VERSION_MINOR }}" \
61
56
docker buildx bake \
62
57
--set "*.platform=linux/amd64,linux/arm64" \
63
58
--set "*.output=type=registry" \
64
59
php${PHP_VERSION//.}-${{ matrix.variant }}-all
65
- docker images --filter=reference=thecodingmachine/php >> $GITHUB_STEP_SUMMARY
0 commit comments