|
| 1 | +name: QA |
| 2 | +on: |
| 3 | + push: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: '40 2 * * *' |
| 7 | + |
| 8 | +jobs: |
| 9 | + tests: |
| 10 | + env: |
| 11 | + TNT_IMAGE: tarantool/tarantool:2.7 |
| 12 | + PHP_IMAGE: php:8.0-cli |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + operating-system: [ubuntu-latest] |
| 16 | + env: |
| 17 | + - PHP_IMAGE: php:7.1-cli |
| 18 | + - PHP_IMAGE: php:7.2-cli |
| 19 | + |
| 20 | + - PHP_IMAGE: php:7.3-cli |
| 21 | + QA: 1 |
| 22 | + |
| 23 | + - PHP_IMAGE: php:7.4-cli |
| 24 | + COVERAGE_FILE: coverage.clover |
| 25 | + |
| 26 | + - PHP_IMAGE: php:8.0-cli |
| 27 | + |
| 28 | + - TNT_IMAGE: tarantool/tarantool:1.7 |
| 29 | + - TNT_IMAGE: tarantool/tarantool:1.9 |
| 30 | + - TNT_IMAGE: tarantool/tarantool:1 |
| 31 | + - TNT_IMAGE: tarantool/tarantool:2.1 |
| 32 | + - TNT_IMAGE: tarantool/tarantool:2.3 |
| 33 | + - TNT_IMAGE: tarantool/tarantool:2.4 |
| 34 | + - TNT_IMAGE: tarantool/tarantool:2.5 |
| 35 | + - TNT_IMAGE: tarantool/tarantool:2.6 |
| 36 | + |
| 37 | + runs-on: ${{ matrix.operating-system }} |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@v2 |
| 41 | + |
| 42 | + - name: Build docker image |
| 43 | + env: ${{ matrix.env }} |
| 44 | + run: ./dockerfile.sh | tee /dev/tty | docker build -t queue - |
| 45 | + |
| 46 | + - name: Test |
| 47 | + env: ${{ matrix.env }} |
| 48 | + run: | |
| 49 | + docker network create tarantool-php |
| 50 | + docker run --net=tarantool-php --rm $TNT_IMAGE /usr/local/bin/tarantool --version |
| 51 | + docker run -d --net=tarantool-php --name=tarantool -v `pwd`:/queue -e TNT_LISTEN_URI=$TNT_LISTEN_URI ${TNT_IMAGE} tarantool /queue/tests/Integration/queues.lua |
| 52 | + docker run --rm --net=tarantool-php -v `pwd`:/queue -w /queue queue |
| 53 | +
|
| 54 | + - name: Check code quality |
| 55 | + env: ${{ matrix.env }} |
| 56 | + if: ${{ env.QA }} |
| 57 | + run: | |
| 58 | + docker run --net=tarantool-php --rm -v $PWD:/queue -w /queue queue php vendor/bin/php-cs-fixer fix --dry-run --diff --verbose . |
| 59 | + docker run --net=tarantool-php --rm -v $PWD:/queue -w /queue queue php vendor/bin/psalm |
| 60 | +
|
| 61 | + - name: Upload code coverage to Scrutinizer |
| 62 | + env: ${{ matrix.env }} |
| 63 | + if: ${{ env.COVERAGE_FILE }} |
| 64 | + run: | |
| 65 | + curl -sSOL https://scrutinizer-ci.com/ocular.phar |
| 66 | + docker run --rm -v $(pwd):/queue -w /queue queue php ocular.phar code-coverage:upload --format=php-clover "$COVERAGE_FILE" |
0 commit comments