Skip to content

QA

QA #1361

Workflow file for this run

name: QA
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: '40 2 * * *'
jobs:
tests:
env:
TNT_IMAGE: tarantool/tarantool:3.1
PHP_IMAGE: php:8.3-cli
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
env:
- TNT_IMAGE: tarantool/tarantool:3.0
- TNT_IMAGE: tarantool/tarantool:2.11
- TNT_IMAGE: tarantool/tarantool:2.10
- TNT_IMAGE: tarantool/tarantool:2.8
- TNT_IMAGE: tarantool/tarantool:2.7
- TNT_IMAGE: tarantool/tarantool:2.6
- TNT_IMAGE: tarantool/tarantool:2.5
- TNT_IMAGE: tarantool/tarantool:2.4
- TNT_IMAGE: tarantool/tarantool:2.3
- TNT_IMAGE: tarantool/tarantool:2.2
- TNT_IMAGE: tarantool/tarantool:2.1
- TNT_IMAGE: tarantool/tarantool:1
- TNT_IMAGE: tarantool/tarantool:1.9
- TNT_IMAGE: tarantool/tarantool:1.7
- PHP_IMAGE: php:8.3-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- PHP_IMAGE: php:8.2-cli
- PHP_IMAGE: php:8.2-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- PHP_IMAGE: php:8.1-cli
- PHP_IMAGE: php:8.1-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- PHP_IMAGE: php:8.0-cli
- PHP_IMAGE: php:8.0-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- PHP_IMAGE: php:7.4-cli
- PHP_IMAGE: php:7.4-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- PHP_IMAGE: php:7.3-cli
QA: 1
- PHP_IMAGE: php:7.3-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- PHP_IMAGE: php:7.2-cli
- PHP_IMAGE: php:7.2-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- COVERAGE_FILE: coverage.clover
# scrutinizer doesn't support PHP 8
PHP_IMAGE: php:7.4-cli
- COVERAGE_FILE: coverage.clover
# scrutinizer doesn't support PHP 8
PHP_IMAGE: php:7.4-cli
EXT_DISABLE_DECIMAL: true
- COVERAGE_FILE: coverage.clover
# scrutinizer doesn't support PHP 8
PHP_IMAGE: php:7.4-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock
- COVERAGE_FILE: coverage.clover
# scrutinizer doesn't support PHP 8
PHP_IMAGE: php:7.4-cli
# some tests are skipped on Tarantool > 2.8
TNT_IMAGE: tarantool/tarantool:2.8
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build docker image
env: ${{ matrix.env }}
run: ./dockerfile.sh | docker build -t client -
- name: Test
env: ${{ matrix.env }}
run: |
docker network create tarantool-php
docker run --net=tarantool-php --rm $TNT_IMAGE sh -c "tarantool --version"
docker run --net=tarantool-php -d --name=tarantool -v /tmp:/tmp -v $PWD/tests/Integration/client.lua:/client.lua -e TNT_LISTEN_URI=$TNT_LISTEN_URI $TNT_IMAGE tarantool /client.lua
docker run --net=tarantool-php --rm -v /tmp:/tmp -v $PWD:/client -w /client -e COMPOSER_ROOT_VERSION=dev-master client
- name: Check code quality
env: ${{ matrix.env }}
if: ${{ env.QA }}
run: |
docker run --net=tarantool-php --rm -v $PWD:/client -w /client client php vendor/bin/php-cs-fixer fix --dry-run --diff --verbose .
docker run --net=tarantool-php --rm -v $PWD:/client -w /client client php vendor/bin/psalm
- name: Upload code coverage to Scrutinizer
env: ${{ matrix.env }}
if: ${{ env.COVERAGE_FILE }}
run: |
curl -sSOL https://scrutinizer-ci.com/ocular.phar
docker run --net=tarantool-php --rm -v $PWD:/client -w /client client php ocular.phar code-coverage:upload --format=php-clover "$COVERAGE_FILE"