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 17, 2020
1 parent df0ba29 commit f26282b
Showing 1 changed file with 49 additions and 5 deletions.
54 changes: 49 additions & 5 deletions .github/workflows/build.yml
Expand Up @@ -5,11 +5,52 @@ on:
push:

jobs:
phpstan:
name: PHPStan
# phpstan:
# name: PHPStan
#
# runs-on: ubuntu-latest
#
# 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
#
# - 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
Expand All @@ -31,7 +72,10 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies
run: composer install --prefer-dist
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 && cat ./tests/databases.ini

- name: Run PHPStan
run: composer phpstan
- name: Tests
run: ./tests/run.sh ./tests/cases

0 comments on commit f26282b

Please sign in to comment.