@@ -14,52 +14,50 @@ jobs:
1414 build_test_maybe_release :
1515 strategy :
1616 matrix :
17- php_version : ['8.1','8.0','7.4', '7.3','7.2']
18- variant : ['apache','cli','fpm']
17+ php_version : ['8.0'] # ['8. 1','8.0','7.4', '7.3','7.2']
18+ variant : ['cli'] # [' apache','cli','fpm']
1919 runs-on : ubuntu-latest
2020 steps :
21+ - name : Checkout
22+ uses : actions/checkout@v3
2123 - name : Set up QEMU
22- uses : docker/setup-qemu-action@v1
24+ uses : docker/setup-qemu-action@v2
2325 - 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+ id : buildx
27+ uses : docker/setup-buildx-action@v2
28+ - name : Available platforms
29+ run : echo ${{ steps.buildx.outputs.platforms }}
30+ - name : Build locally (amd64)
31+ run : |
32+ PHP_VERSION="${{ matrix.php_version }}"
33+ # Slim
34+ docker buildx bake --load \
35+ --set "*.platform=linux/amd64" \
36+ php${PHP_VERSION//.}-${{ matrix.variant }}-all
37+ # Fetch minor version
38+ PHP_VERSION_MINOR=`docker run --rm thecodingmachine/php:${PHP_VERSION}-v4-slim-${{ matrix.variant }}-test php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
39+ echo "PHP_VERSION_MINOR=${PHP_VERSION_MINOR}" >> $GITHUB_ENV
40+ # Summary
41+ echo "PHP Version : ${PHP_VERSION_MINOR}" >> $GITHUB_STEP_SUMMARY
42+ docker images --filter=reference=thecodingmachine/php >> $GITHUB_STEP_SUMMARY
43+ docker images --filter=reference=thecodingmachine/php
44+ - name : Test variant '${{ matrix.variant }}' (amd64)
45+ run : |
46+ PHP_VERSION="${{ matrix.php_version }}" BRANCH=v4 VARIANT=${{ matrix.variant }} ./tests-suite/bash_unit -f tap ./tests-suite/*.sh
4447 - name : Login to DockerHub
4548 # Merge ~ push.
4649 if : ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
4750 uses : docker/login-action@v1
4851 with :
4952 username : ${{ secrets.DOCKERHUB_USERNAME }}
5053 password : ${{ secrets.DOCKERHUB_TOKEN }}
51- - name : Build and push to repository
54+ - name : Build and push to repository (both amd64 and arm64)
5255 # Merge ~ push.
5356 if : ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
5457 run : |
5558 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` \
59+ PHP_PATCH_MINOR="${{ env.PHP_VERSION_MINOR }}" \
6160 docker buildx bake \
6261 --set "*.platform=linux/amd64,linux/arm64" \
6362 --set "*.output=type=registry" \
6463 php${PHP_VERSION//.}-${{ matrix.variant }}-all
65- docker images --filter=reference=thecodingmachine/php >> $GITHUB_STEP_SUMMARY
0 commit comments