Blame | Last modification | View Log | Download
name: Testson:pull_request: nullpush:branches:- mainjobs:integration:runs-on: ubuntu-latestservices:mysql:image: mysql:latestenv:MYSQL_ALLOW_EMPTY_PASSWORD: falseMYSQL_ROOT_PASSWORD: kimaiMYSQL_DATABASE: kimaiports:- 3306/tcpoptions: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3strategy:matrix:php: ['8.1', '8.2', '8.3']name: Integration (${{ matrix.php }})steps:- name: Clone Kimaiuses: actions/checkout@v4with:persist-credentials: false- name: Setup PHPuses: shivammathur/setup-php@v2with:php-version: ${{ matrix.php }}coverage: pcovextensions: ctype, gd, iconv, intl, ldap, mbstring, mysql, xml, ziptools: cs2pr, symfony-clienv:fail-fast: true- name: Determine composer cache directoryid: composer-cacherun: echo "composer_cache_directory=$(composer config cache-dir)" >> $GITHUB_ENV- name: Cache Composer dependenciesuses: actions/cache@v3with:path: "${{ env.composer_cache_directory }}"key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}- name: Install dependenciesrun: composer install- name: Validate Composerrun: composer validate --strict- name: Warmup cacherun: APP_ENV=dev bin/console kimai:reload -n- name: Check codestylesrun: PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist.php --using-cache=no --show-progress=none --format=checkstyle | cs2pr- name: Run PHPStan for applicationrun: vendor/bin/phpstan analyse -c phpstan.neon --no-progress --error-format=checkstyle | cs2pr- name: Run PHPStan for testsrun: vendor/bin/phpstan analyse -c tests/phpstan.neon --no-progress --error-format=checkstyle | cs2pr- name: Lint codebaserun: composer linting- name: Install LDAP package (for tests)run: composer require laminas/laminas-ldap- name: Setup problem matchers (for PHPUnit)run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"- name: Run quick unit-testsrun: composer tests-unitenv:DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7APP_ENV: devMAILER_URL: null://localhost- name: Full test-suite with coveragerun: vendor/bin/phpunit tests/ --coverage-clover=coverage.xmlenv:DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7APP_ENV: devMAILER_URL: null://localhostTEST_WITH_BUNDLES: 1- name: Upload code coverageif: matrix.php == '8.2'uses: codecov/codecov-action@v3with:token: ${{ secrets.CODECOV_TOKEN }}files: ./coverage.xmlfail_ci_if_error: true- name: Run migrations on MySQLrun: |bin/console doctrine:database:drop --if-exists --force -nbin/console doctrine:database:create --if-not-exists -nbin/console doctrine:migrations:migrate -nbin/console doctrine:migrations:migrate first -nenv:DATABASE_URL: mysql://root:kimai@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/kimai?serverVersion=5.7APP_ENV: devMAILER_URL: null://localhost- name: Check for security issues in packagesrun: symfony security:check