Skip to content

✨ [NFE-180] Adicionando suporte ao PHP 8.3 #77

✨ [NFE-180] Adicionando suporte ao PHP 8.3

✨ [NFE-180] Adicionando suporte ao PHP 8.3 #77

Workflow file for this run

name: Test and Publish
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
test:
strategy:
matrix:
PHP: [73, 74, 80, 81, 82, 83]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prepare code
env:
PHP_VERSION: ${{ matrix.PHP }}
run: |
touch .env
echo "GITHUB_TOKEN=${{ secrets.GH_TOKEN }}" >> .env
echo "CODECOMMIT_HOST=${{ secrets.CODECOMMIT_HOST }}" >> .env
echo "CODECOMMIT_USER=${{ secrets.CODECOMMIT_USER }}" >> .env
echo "CODECOMMIT_PASSWORD=${{ secrets.CODECOMMIT_PASSWORD }}" >> .env
echo "VERSAO=${PHP_VERSION}-dev" >> .env
ln -s www73 www74
ln -s www80 www81
ln -s www80 www82
ln -s www80 www83
- name: Run tests
env:
PHP_VERSION: ${{ matrix.PHP }}
run: |
docker pull likesistemas/php -a
docker-compose -f docker-compose-${PHP_VERSION}.yml up --build -d
echo $(docker run -t --network php jwilder/dockerize -wait http://php_nginx/ -timeout 60s)
docker ps -a
docker logs php_app
CONTENT=$(curl -s "http://127.0.0.1/");
echo "CHAMADA HTTP: ${CONTENT}";
if [ "${CONTENT}" != "Like Sistemas|123|${PHP_VERSION}" ]; then
echo "Chamada HTTP retornou errado: ${CONTENT}"
exit 1;
fi
LOGS_FILE="www${PHP_VERSION}/events.log";
if [ ! -f "$LOGS_FILE" ]; then
echo "Arquivo de logs não existe. >> ${LOGS_FILE}";
ls -la "www${PHP_VERSION}/";
exit 2;
fi
LOGS=$(cat $LOGS_FILE);
echo "EVENTS LOG: ${LOGS}";
if [[ ! $LOGS =~ "started" ]]; then exit 10; fi
if [[ ! $LOGS =~ "src-copied" ]]; then exit 11; fi
if [[ ! $LOGS =~ "composer-ready" ]]; then exit 12; fi
if [[ ! $LOGS =~ "composer-vendor-ready" ]]; then exit 13; fi
if [[ ! $LOGS =~ "db-ready" ]]; then exit 14; fi
if [[ ! $LOGS =~ "db-migrated" ]]; then exit 15; fi
if [[ ! $LOGS =~ "db-sown" ]]; then exit 16; fi
if [[ ! $LOGS =~ "ready" ]]; then exit 17; fi
- name: Run tests prod
env:
PHP_VERSION: ${{ matrix.PHP }}
run: |
docker-compose -f docker-compose-${PHP_VERSION}.yml -f docker-compose.prod.yml up --build -d
echo $(docker run -t --network php jwilder/dockerize -wait http://php_nginx/ -timeout 60s)
docker ps -a
docker logs php_app
CONTENT=$(curl -s "http://127.0.0.1/");
echo "CHAMADA HTTP: ${CONTENT}";
if [ "${CONTENT}" != "${PHP_VERSION}" ]; then
echo "Chamada HTTP retornou errado: ${CONTENT}"
exit 1;
fi
- name: Run tests cli
env:
PHP_VERSION: ${{ matrix.PHP }}
run: |
CLI_RETURN=$(docker run -e CLI=true likesistemas/php:${PHP_VERSION}-dev php -r "echo 'cmd=lk';");
echo "CLI: ${CLI_RETURN}";
if [[ ! $CLI_RETURN =~ "cmd=lk" ]]; then
echo "Chamada CLI retornou errado: ${CLI_RETURN}"
exit 1;
fi
- name: Run k6
run: |
docker-compose -f docker-compose.k6.yml up
push:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: PHP 5.6 -> Build and push
# uses: docker/build-push-action@v2
# with:
# context: .
# file: ./Dockerfile-56
# push: true
# tags: |
# likesistemas/php:56
# likesistemas/php:5.6
# ghcr.io/likesistemas/php:56
# ghcr.io/likesistemas/php:5.6
- name: PHP 7.3 -> Build and push
continue-on-error: true
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-73
push: true
tags: |
likesistemas/php:latest
likesistemas/php:73
likesistemas/php:7.3
# ghcr.io/likesistemas/php:latest
# ghcr.io/likesistemas/php:73
# ghcr.io/likesistemas/php:7.3
- name: PHP 7.4 -> Build and push
continue-on-error: true
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-80
push: true
build-args: |
PHP_VERSION=7.4-fpm
tags: |
likesistemas/php:74
likesistemas/php:7.4
# ghcr.io/likesistemas/php:74
# ghcr.io/likesistemas/php:7.4
- name: PHP 8.0 -> Build and push
continue-on-error: true
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-80
push: true
tags: |
likesistemas/php:80
likesistemas/php:8.0
# ghcr.io/likesistemas/php:80
# ghcr.io/likesistemas/php:8.0
- name: PHP 8.1 -> Build and push
continue-on-error: true
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-80
push: true
build-args: |
PHP_VERSION=8.1-fpm
tags: |
likesistemas/php:81
likesistemas/php:8.1
# ghcr.io/likesistemas/php:81
# ghcr.io/likesistemas/php:8.1
- name: PHP 8.2 -> Build and push
continue-on-error: true
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-80
push: true
build-args: |
PHP_VERSION=8.2-fpm
tags: |
likesistemas/php:82
likesistemas/php:8.2
# ghcr.io/likesistemas/php:82
# ghcr.io/likesistemas/php:8.2
- name: PHP 8.3 -> Build and push
continue-on-error: true
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-80
push: true
build-args: |
PHP_VERSION=8.3-rc-fpm
tags: |
likesistemas/php:83
likesistemas/php:8.3
# ghcr.io/likesistemas/php:83
# ghcr.io/likesistemas/php:8.3