Skip to content

Commit

Permalink
gactions: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Oct 11, 2020
1 parent df0ba29 commit 4eae07f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -35,3 +35,47 @@ jobs:

- name: Run PHPStan
run: composer phpstan

tests:
name: Tests

runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: nextras_dbal_test
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP with pecl extension
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress --no-suggest

- name: Init config
run: cp ./tests/php.unix-sample.ini ./tests/php.ini && cp ./tests/databases.sample.ini ./tests/databases.ini && sed -i -e 's/3306/${{ job.services.mysql.ports[3306] }}/g' ./tests/databases.ini

- name: Tests
run: ./tests/run.sh ./tests/cases

0 comments on commit 4eae07f

Please sign in to comment.