Skip to content

Commit f4f680a

Browse files
authored
Merge pull request #132 from SimonFrings/ci
Use GitHub actions for continuous integration (CI)
2 parents f57dbe0 + c36f316 commit f4f680a

File tree

5 files changed

+56
-38
lines changed

5 files changed

+56
-38
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
PHPUnit:
9+
name: PHPUnit (PHP ${{ matrix.php }})
10+
runs-on: ubuntu-20.04
11+
strategy:
12+
matrix:
13+
php:
14+
- 7.4
15+
- 7.3
16+
- 7.2
17+
- 7.1
18+
- 7.0
19+
- 5.6
20+
- 5.5
21+
- 5.4
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
coverage: xdebug
28+
- run: composer install
29+
- run: docker run -d --name mysql --net=host -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_DATABASE=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test mysql:5
30+
- run: bash tests/wait-for-mysql.sh
31+
- run: MYSQL_USER=test MYSQL_PASSWORD=test vendor/bin/phpunit
32+
33+
PHPUnit-hhvm:
34+
name: PHPUnit (HHVM)
35+
runs-on: ubuntu-18.04
36+
continue-on-error: true
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: azjezz/setup-hhvm@v1
40+
with:
41+
version: lts-3.30
42+
- run: hhvm $(which composer) require phpunit/phpunit:^5 --dev --no-interaction
43+
- run: docker run -d --name mysql --net=host -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_DATABASE=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test mysql:5
44+
- run: bash tests/wait-for-mysql.sh
45+
- run: MYSQL_USER=test MYSQL_PASSWORD=test hhvm vendor/bin/phpunit

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
vendor/
2-
composer.lock
1+
/composer.lock
2+
/vendor/

.travis.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# MySQL
33

4-
[![Build Status](https://travis-ci.org/friends-of-reactphp/mysql.svg?branch=master)](https://travis-ci.org/friends-of-reactphp/mysql)
4+
[![CI status](https://github.com/friends-of-reactphp/mysql/workflows/CI/badge.svg)](https://github.com/friends-of-reactphp/mysql/actions)
55

66
Async MySQL database client for [ReactPHP](https://reactphp.org/).
77

tests/wait-for-mysql.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
CONTAINER="mysql"
4+
USERNAME="test"
5+
PASSWORD="test"
6+
while ! docker exec $CONTAINER mysql --user=$USERNAME --password=$PASSWORD -e "SELECT 1" >/dev/null 2>&1; do
7+
sleep 1
8+
done

0 commit comments

Comments
 (0)