Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,51 @@ jobs:
run: |
yarn install --frozen-lockfile --non-interactive
yarn test

sqlite:
runs-on: ubuntu-latest
name: "Test application / PHP 8.4 / Symfony ^7.4 / SQLite"
env:
APP_ENV: test
COMPOSER_ROOT_VERSION: "dev-main"
DATABASE_URL: "sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.4"
extensions: pdo_sqlite
tools: 'composer:v2, flex'
coverage: none

- name: "Restrict packages' versions"
run: composer config extra.symfony.require "^7.4"

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: "Setup cache"
uses: actions/cache@v3
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: ${{ github.run_id }}-${{ runner.os }}-sqlite-${{ hashFiles('composer.json') }}-symfony-^7.4

- name: "Install dependencies"
run: composer update --no-interaction --no-scripts

- name: Create Testing database
run: bin/console doctrine:schema:create

- name: "Install & compile assets"
run: |
bin/console importmap:install
bin/console tailwind:build
bin/console asset-map:compile

- name: Run PHPUnit
run: vendor/bin/phpunit
2 changes: 1 addition & 1 deletion app/Doctrine/Query/AST/Function/Day.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getSql(SqlWalker $sqlWalker): string
}

if ($platform instanceof SqlitePlatform) {
return sprintf('CAST(STRFTIME("%%d", %s) AS NUMBER)', $sqlWalker->walkArithmeticPrimary($this->date));
return sprintf("CAST(STRFTIME('%%d', %s) AS INTEGER)", $sqlWalker->walkArithmeticPrimary($this->date));
}

throw new \RuntimeException(sprintf('Platform "%s" is not supported!', $platform::class));
Expand Down
2 changes: 1 addition & 1 deletion app/Doctrine/Query/AST/Function/Month.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getSql(SqlWalker $sqlWalker): string
}

if ($platform instanceof SqlitePlatform) {
return sprintf('CAST(STRFTIME("%%m", %s) AS NUMBER)', $sqlWalker->walkArithmeticPrimary($this->date));
return sprintf("CAST(STRFTIME('%%m', %s) AS INTEGER)", $sqlWalker->walkArithmeticPrimary($this->date));
}

throw new \RuntimeException(sprintf('Platform "%s" is not supported!', $platform::class));
Expand Down
2 changes: 1 addition & 1 deletion app/Doctrine/Query/AST/Function/Year.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getSql(SqlWalker $sqlWalker): string
}

if ($platform instanceof SqlitePlatform) {
return sprintf('CAST(STRFTIME("%%Y", %s) AS NUMBER)', $sqlWalker->walkArithmeticPrimary($this->date));
return sprintf("CAST(STRFTIME('%%Y', %s) AS INTEGER)", $sqlWalker->walkArithmeticPrimary($this->date));
}

throw new \RuntimeException(sprintf('Platform "%s" is not supported!', $platform::class));
Expand Down
Loading