Skip to content

Commit

Permalink
Add tarantool v3.x to the test matrix (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
rybakit authored Jun 20, 2024
1 parent 6a79c74 commit 9b02251
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 35 deletions.
61 changes: 33 additions & 28 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,54 @@ on:
jobs:
tests:
env:
TNT_IMAGE: tarantool/tarantool:2.11
PHP_IMAGE: php:8.2-cli
TNT_IMAGE: tarantool/tarantool:3.1
PHP_IMAGE: php:8.3-cli
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
env:
- PHP_IMAGE: php:7.2-cli
- PHP_IMAGE: php:7.2-cli
- 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:7.3-cli
QA: 1
- PHP_IMAGE: php:7.3-cli
- PHP_IMAGE: php:8.2-cli
- PHP_IMAGE: php:8.2-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock

- PHP_IMAGE: php:7.4-cli
- PHP_IMAGE: php:7.4-cli
- 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:8.1-cli
- PHP_IMAGE: php:8.1-cli
- PHP_IMAGE: php:7.4-cli
- PHP_IMAGE: php:7.4-cli
TNT_LISTEN_URI: /tmp/tarantool_client.sock

- PHP_IMAGE: php:8.3-cli
- PHP_IMAGE: php:8.3-cli
- 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
Expand All @@ -58,33 +76,20 @@ jobs:
# 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 -
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 /usr/local/bin/tarantool --version
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: sudo dpkg -i tarantool*.deb

- name: Build docker image with connector setup
run: ./dockerfile.sh | tee /dev/tty | docker build -t client -
run: ./dockerfile.sh | docker build -t client -
env:
TNT_LISTEN_URI: localhost:3301

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -702,11 +702,11 @@ First, create a container:
./dockerfile.sh | docker build -t client -
```

The command above will create a container named `client` with PHP 8.2 runtime.
The command above will create a container named `client` with PHP 8.3 runtime.
You may change the default runtime by defining the `PHP_IMAGE` environment variable:

```bash
PHP_IMAGE='php:8.1-cli' ./dockerfile.sh | docker build -t client -
PHP_IMAGE='php:8.2-cli' ./dockerfile.sh | docker build -t client -
```

> *See a list of various images [here](https://hub.docker.com/_/php).*
Expand All @@ -718,7 +718,7 @@ Then run a Tarantool instance (needed for integration tests):
docker network create tarantool-php
docker run -d --net=tarantool-php -p 3301:3301 --name=tarantool \
-v $(pwd)/tests/Integration/client.lua:/client.lua \
tarantool/tarantool:2 tarantool /client.lua
tarantool/tarantool:3 tarantool /client.lua
```

And then run both unit and integration tests:
Expand Down
2 changes: 1 addition & 1 deletion dockerfile.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

if [[ -z "$PHP_IMAGE" ]]; then
PHP_IMAGE='php:8.2-cli'
PHP_IMAGE='php:8.3-cli'
fi

if [[ -z "$TNT_LISTEN_URI" ]]; then
Expand Down
2 changes: 0 additions & 2 deletions tests/Integration/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ local listen = os.getenv('TNT_LISTEN_URI')
box.cfg {
listen = (listen == '' or listen == nil) and 3301 or listen,
log_level = 6,
wal_mode = 'none',
snap_dir = '/tmp'
}

box.schema.user.grant('guest', 'read,write,execute,create,drop,alter', 'universe', nil, {if_not_exists = true})
Expand Down

0 comments on commit 9b02251

Please sign in to comment.