-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from elvanto/gh-actions
Add GitHub Actions test workflow
- Loading branch information
Showing
14 changed files
with
363 additions
and
107 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,136 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test_mysql57: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
php-versions: [ '7.0', '7.1', '7.2', '7.3', '7.4' ] | ||
name: PHP ${{ matrix.php-versions }} with MySQL 5.7 & Postgres 10 | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_USER: root | ||
MYSQL_DATABASE: picodb | ||
MYSQL_ROOT_PASSWORD: rootpassword | ||
MYSQL_HOST: 127.0.0.1 | ||
ports: | ||
[ '3306:3306' ] | ||
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10 | ||
|
||
postgres: | ||
image: postgres:10 | ||
env: | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: rootpassword | ||
POSTGRES_DB: picodb | ||
ports: | ||
[ '5432:5432' ] | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Check Out Code | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: pdo_mysql, pdo_pgsql, pdo_sqlite | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run test suite | ||
run: ./vendor/bin/phpunit | ||
|
||
test_mysql80: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
php-versions: [ '7.4' ] | ||
name: PHP ${{ matrix.php-versions }} with MySQL 8.0 & Postgres 11 | ||
|
||
services: | ||
mysql: | ||
image: mysql:8.0 | ||
env: | ||
MYSQL_USER: root | ||
MYSQL_DATABASE: picodb | ||
MYSQL_ROOT_PASSWORD: rootpassword | ||
MYSQL_HOST: 127.0.0.1 | ||
ports: | ||
[ '3306:3306' ] | ||
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10 | ||
|
||
postgres: | ||
image: postgres:11 | ||
env: | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: rootpassword | ||
POSTGRES_DB: picodb | ||
ports: | ||
[ '5432:5432' ] | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
name: Check Out Code | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: pdo_mysql, pdo_pgsql, pdo_sqlite | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
if: steps.composer-cache.outputs.cache-hit != 'true' | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run test suite | ||
run: ./vendor/bin/phpunit |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.