-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup PHPUnit tests on GitHub Actions
- Loading branch information
Showing
4 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "Tests: MongoDB" | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
mongodb: | ||
name: PHP ${{ matrix.php }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
php: | ||
- "7.0" | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
- "7.4" | ||
|
||
services: | ||
mongodb: | ||
image: percona/percona-server-mongodb:3.6 | ||
ports: | ||
- 27017:27017/tcp | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mongodb | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHPUnit tests | ||
run: composer test | ||
env: | ||
XHGUI_SAVE_HANDLER: "mongodb" | ||
|
||
- name: MongoDB Service logs | ||
run: docker logs ${{ job.services.mongodb.id }} | ||
if: always() | ||
|
||
# vim:ft=yaml:et:ts=2:sw=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Tests: MySQL" | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
mysql: | ||
name: PHP ${{ matrix.php }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
php: | ||
- "7.0" | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
|
||
services: | ||
mysql: | ||
image: percona/percona-server:5.7 | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_USER: "xhgui" | ||
MYSQL_PASSWORD: "password" | ||
MYSQL_DATABASE: "xhgui" | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "1" | ||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: pdo, pdo_mysql | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHPUnit tests | ||
run: composer test | ||
env: | ||
XHGUI_SAVE_HANDLER: "pdo" | ||
XHGUI_PDO_DSN: "mysql:host=127.0.0.1;dbname=xhgui" | ||
XHGUI_PDO_USER: "xhgui" | ||
XHGUI_PDO_PASS: "password" | ||
|
||
- name: MySQL Service logs | ||
run: docker logs ${{ job.services.mysql.id }} | ||
if: always() | ||
|
||
# vim:ft=yaml:et:ts=2:sw=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: "Tests: PostgreSQL" | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
pgsql: | ||
name: PHP ${{ matrix.php }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
php: | ||
- "7.0" | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
|
||
services: | ||
# https://docs.github.com/en/free-pro-team@latest/actions/guides/creating-postgresql-service-containers | ||
pgsql: | ||
image: postgres:9.2 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_USER: "postgres" | ||
POSTGRES_PASSWORD: "password" | ||
POSTGRES_DB: "xhgui" | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: pdo, pdo_pgsql | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHPUnit tests | ||
run: composer test | ||
env: | ||
XHGUI_SAVE_HANDLER: "pdo" | ||
XHGUI_PDO_DSN: "pgsql:host=127.0.0.1;dbname=xhgui user=postgres password=password" | ||
|
||
- name: PostgreSQL service logs | ||
run: docker logs ${{ job.services.pgsql.id }} | ||
if: always() | ||
|
||
# vim:ft=yaml:et:ts=2:sw=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "Tests: Sqlite" | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
sqlite: | ||
name: PHP ${{ matrix.php }} | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
php: | ||
- "7.0" | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: pdo, pdo_sqlite | ||
coverage: none | ||
|
||
- name: Install dependencies | ||
run: composer install | ||
|
||
- name: Run PHPUnit tests | ||
run: composer test | ||
env: | ||
XHGUI_SAVE_HANDLER: "pdo" | ||
XHGUI_PDO_DSN: "sqlite:/tmp/xhgui.sqlite3" | ||
|
||
# vim:ft=yaml:et:ts=2:sw=2 |