QA #1262
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
name: QA | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: '40 2 * * *' | |
jobs: | |
tests: | |
env: | |
TNT_IMAGE: tarantool/tarantool:2.11 | |
PHP_IMAGE: php:8.2-cli | |
strategy: | |
fail-fast: false | |
matrix: | |
operating-system: [ubuntu-latest] | |
env: | |
- PHP_IMAGE: php:7.2-cli | |
- PHP_IMAGE: php:7.2-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.4-cli | |
- PHP_IMAGE: php:7.4-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:8.1-cli | |
- PHP_IMAGE: php:8.1-cli | |
TNT_LISTEN_URI: /tmp/tarantool_client.sock | |
- PHP_IMAGE: php:8.3-cli | |
- PHP_IMAGE: php:8.3-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 | |
- TNT_IMAGE: tarantool/tarantool:1.7 | |
- TNT_IMAGE: tarantool/tarantool:1.9 | |
- TNT_IMAGE: tarantool/tarantool:1 | |
- TNT_IMAGE: tarantool/tarantool:2.1 | |
- TNT_IMAGE: tarantool/tarantool:2.2 | |
- TNT_IMAGE: tarantool/tarantool:2.3 | |
- TNT_IMAGE: tarantool/tarantool:2.4 | |
- TNT_IMAGE: tarantool/tarantool:2.5 | |
- TNT_IMAGE: tarantool/tarantool:2.6 | |
- TNT_IMAGE: tarantool/tarantool:2.7 | |
- TNT_IMAGE: tarantool/tarantool:2.8 | |
- TNT_IMAGE: tarantool/tarantool:2.10 | |
runs-on: ${{ matrix.operating-system }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build docker image | |
env: ${{ matrix.env }} | |
run: ./dockerfile.sh | tee /dev/tty | docker build -t client - | |
- name: Test | |
env: ${{ matrix.env }} | |
run: | | |
docker network create tarantool-php | |
docker run --net=tarantool-php --rm $TNT_IMAGE /usr/local/bin/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" |