Skip to content

Test

Test #394

Workflow file for this run

on:
push:
pull_request:
schedule:
- cron: '0 2 * * *'
name: Test
jobs:
ci:
name: Test for Golang ${{ matrix.go-version }} on ${{ matrix.platform }}
strategy:
matrix:
go-version: [ 1.18.x, 1.19.x, 1.20.x ]
platform: [ ubuntu-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Fetch Repository
uses: actions/checkout@v2
- name: Setup JSON RPC Server
run: |
docker build . -f examples/json_rpc/Dockerfile -t json_rpc
docker run -p 9501:9501 --rm --name json_rpc_server -d json_rpc:latest
- name: Run Test
run: go test ./... -v -race
ci_for_hyperf:
name: Test on PHP ${{ matrix.php-version }} Swoole ${{ matrix.swoole-version }}
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os: [ ubuntu-latest ]
php-version: [ '8.0', '8.1' ]
swoole-version: [ 'v5.0.0', 'master' ]
max-parallel: 5
env:
SW_VERSION: ${{ matrix.swoole-version }}
PHP_VERSION: ${{ matrix.php-version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: phpize
ini-values: opcache.enable_cli=0
coverage: none
extensions: pdo, pdo_mysql, redis
- name: Setup Swoole
run: |
cd /tmp
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
wget https://github.com/swoole/swoole-src/archive/${SW_VERSION}.tar.gz -O swoole.tar.gz
mkdir -p swoole
tar -xf swoole.tar.gz -C swoole --strip-components=1
rm swoole.tar.gz
cd swoole
phpize
./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json
make -j$(nproc)
sudo make install
sudo sh -c "echo extension=swoole > /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini"
sudo sh -c "echo swoole.use_shortname='Off' >> /etc/php/${PHP_VERSION}/cli/conf.d/swoole.ini"
php --ri swoole
- name: Setup JSON RPC Server
run: |
docker build . -f examples/json_rpc/Dockerfile -t json_rpc
docker run -p 9501:9501 --rm --name json_rpc_server -d json_rpc:latest
- name: Show Environment
run: |
php -v
php -m
php -i
- name: Run Test Cases
run: |
git clone https://github.com/kydever/roc-client-test.git
cd roc-client-test
cp .env.example .env
composer update -oW
composer test