0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-16 05:53:29 +00:00
kevinpapst_kimai2/.github/workflows/testing.yaml

58 lines
2.3 KiB
YAML
Raw Normal View History

2020-02-10 19:29:43 +00:00
name: CI
on:
pull_request: null
push:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: kimai
MYSQL_DATABASE: kimai
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
matrix:
php: ['7.2', '7.3', '7.4']
2020-02-10 19:29:43 +00:00
name: Tests - PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
2020-10-26 10:21:03 +00:00
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
2021-03-08 15:06:22 +00:00
extensions: mbstring, xml, ctype, iconv, intl, mysql, zip, gd, ldap
- run: |
composer install --no-progress
2020-06-04 14:21:12 +00:00
composer require laminas/laminas-ldap
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Run unit tests
run: composer kimai:tests-unit
env:
2021-03-08 15:06:22 +00:00
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
APP_ENV: dev
MAILER_URL: null://localhost
- name: Run integration tests
run: composer kimai:tests-integration
env:
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
APP_ENV: dev
MAILER_URL: null://localhost
2021-03-08 15:06:22 +00:00
- name: Run migrations on MySQL
run: |
2021-03-08 15:06:22 +00:00
bin/console doctrine:database:create --if-not-exists -n
bin/console doctrine:migrations:migrate -n
bin/console doctrine:migrations:migrate first -n
env:
2021-03-08 15:06:22 +00:00
DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7
APP_ENV: dev
MAILER_URL: null://localhost