diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6e4f969 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: PHPUnit for Saber + +on: [push, pull_request, workflow_dispatch] + +jobs: + ci: + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: [ubuntu-latest] + max-parallel: 4 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Services + run: | + docker-compose -v + docker -v + ls -al + pwd + mkdir data + mkdir data/mysql + mkdir data/redis + chmod -R 777 data + docker-compose -f .travis-dc.yml up -d + + - name: Run Test Cases + run: | + docker run --rm -v `pwd`:/app:rw -w /app --name="test" phpswoole/swoole:php7.4 composer install-test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 59da8fa..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: required -env: - DOCKER_COMPOSE_VERSION: 1.21.0 -services: - - docker -before_install: - - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin - - docker-compose -v - - docker -v - - ls -al - - pwd - - mkdir data - - mkdir data/mysql - - mkdir data/redis - - chmod -R 777 data -script: - - docker-compose -f .travis-dc.yml up -d - - docker run -it -v `pwd`:/app:rw -w /app --name="test" phpswoole/swoole composer install-test diff --git a/README-EN.md b/README-EN.md index 39178a5..0159ec3 100644 --- a/README-EN.md +++ b/README-EN.md @@ -1,7 +1,7 @@ # Saber [![Latest Version](https://img.shields.io/github/release/swlib/saber.svg?style=flat-square)](https://github.com/swlib/saber/releases) -[![Build Status](https://travis-ci.org/swlib/saber.svg?branch=master)](https://travis-ci.org/swlib/saber) +[![PHPUnit for Saber](https://github.com/swlib/saber/workflows/PHPUnit%20for%20Saber/badge.svg)](https://github.com/swlib/saber/actions) [![Php Version](https://img.shields.io/badge/php-%3E=7.1-brightgreen.svg?maxAge=2592000)](https://secure.php.net/) [![Swoole Version](https://img.shields.io/badge/swoole-%3E=2.1.2-brightgreen.svg?maxAge=2592000)](https://github.com/swoole/swoole-src) [![Saber License](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](https://github.com/swlib/saber/blob/master/LICENSE) diff --git a/README.md b/README.md index 33b10e5..4ef936c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Saber [![Latest Version](https://img.shields.io/github/release/swlib/saber.svg?style=flat-square)](https://github.com/swlib/saber/releases) -[![Build Status](https://travis-ci.org/swlib/saber.svg?branch=master)](https://travis-ci.org/swlib/saber) +[![PHPUnit for Saber](https://github.com/swlib/saber/workflows/PHPUnit%20for%20Saber/badge.svg)](https://github.com/swlib/saber/actions) [![Php Version](https://img.shields.io/badge/php-%3E=7.1-brightgreen.svg?maxAge=2592000)](https://secure.php.net/) [![Swoole Version](https://img.shields.io/badge/swoole-%3E=2.1.2-brightgreen.svg?maxAge=2592000)](https://github.com/swoole/swoole-src) [![Saber License](https://img.shields.io/hexpm/l/plug.svg?maxAge=2592000)](https://github.com/swlib/saber/blob/master/LICENSE)