fix smoke test #96
This file contains hidden or 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
name: Build and test | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
php-versions: ['8.4'] | |
steps: | |
# Install PHP interpreter | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: ctype, iconv, pdo, mbstring, json, xml, zip | |
# Checkout source repository | |
- name: checkout repo | |
uses: actions/checkout@v3 | |
- name: Check escaping in templates | |
run: ./bin/check_templates | |
# Check syntax of every PHP source file using PHP interpreter | |
- run: composer run check-syntax | |
# Install project depencencies incl. development dependencies | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- run: composer install --no-progress | |
# Check codestyle | |
- run: composer run check-codestyle | |
# Run static analysis | |
# - run: ./vendor/bin/psalm | |
# Test app against SQLite database | |
- run: APP_ENV=test DATABASE_DSN="sqlite:var/db_test.sqlite" php bin/console app:database:migrate | |
- run: APP_ENV=test DATABASE_DSN="sqlite:var/db_test.sqlite" php bin/console app:database:seed --months=1 | |
- run: APP_ENV=test DATABASE_DSN="sqlite:var/db_test.sqlite" php bin/phpunit | |
# Test app against MySQL database | |
- run: sudo systemctl start mysql.service | |
- run: sudo mysql -uroot -proot -e 'CREATE DATABASE koko_analytics_test;' | |
- run: APP_ENV=test DATABASE_DSN="mysql:dbname=koko_analytics_test;host=127.0.0.1" php bin/console app:database:migrate | |
- run: APP_ENV=test DATABASE_DSN="mysql:dbname=koko_analytics_test;host=127.0.0.1" php bin/console app:database:seed --months=1 | |
- run: APP_ENV=test DATABASE_DSN="mysql:dbname=koko_analytics_test;host=127.0.0.1" php bin/phpunit | |