Skip to content
Open
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
7 changes: 7 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ GITHUB_SECRET=password_or_token
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
DEFAULT_URI=http://localhost
###< symfony/routing ###

###> doctrine/dbal ###
DATABASE_URL="pdo-mysql://someuser:P@SSW0RD@127.0.0.1:3306/somedatabase?serverVersion=mariadb-11.0.0&charset=utf8mb4"
###< doctrine/dbal ###

# Directory where LSP uploads are stored. Defaults to <project>/tmp.
LSP_DATA_DIR="%kernel.project_dir%/tmp"
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
APP_ENV=test
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

services:
db:
image: mariadb:11
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: somedatabase_test
MARIADB_USER: someuser
MARIADB_PASSWORD: P@SSW0RD
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=10

steps:
- uses: actions/checkout@v4

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: ctype, gd, iconv, intl, pdo, pdo_mysql, simplexml, zlib
coverage: none
tools: composer:v2

- name: Validate composer.json
run: composer validate --strict

- name: Cache vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}

- name: Install dependencies
if: steps.cache-vendor.outputs.cache-hit != 'true'
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Seed schema
run: |
for f in dev/sql/*.sql; do
mysql -h 127.0.0.1 -u someuser -pP@SSW0RD somedatabase_test < "$f"
done

- name: Run tests
run: bin/phpunit
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,20 @@
composer.phar
/**/*.mo

# IDEs
/.idea

###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/public/bundles/
/var/
/config/reference.php
/vendor/
###< symfony/framework-bundle ###

###> phpunit/phpunit ###
/phpunit.xml
/.phpunit.cache/
###< phpunit/phpunit ###
4 changes: 4 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env php
<?php

require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
19 changes: 19 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
db:
image: mariadb:11
environment:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: somedatabase
MARIADB_USER: someuser
MARIADB_PASSWORD: P@SSW0RD
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
ports:
- "3306:3306"
volumes:
- ./dev/sql:/docker-entrypoint-initdb.d:ro
- lsp-db:/var/lib/mysql

volumes:
lsp-db:
23 changes: 16 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"ext-pdo": "*",
"ext-simplexml": "*",
"ext-zlib": "*",
"doctrine/dbal": "^4.4",
"doctrine/doctrine-bundle": "^2.18",
"guzzlehttp/guzzle": "^7.8",
"guzzlehttp/psr7": "^2.6",
"http-interop/http-factory-guzzle": "^1.2",
Expand All @@ -20,14 +22,19 @@
"mgargano/simplehtmldom": "^1.5",
"php-http/guzzle7-adapter": "^1.0",
"psr/cache": "^3.0",
"symfony/browser-kit": "7.4.*",
"symfony/cache": "7.4.*",
"symfony/console": "7.3.*",
"symfony/dotenv": "7.3.*",
"symfony/console": "7.4.*",
"symfony/css-selector": "7.4.*",
"symfony/dotenv": "7.4.*",
"symfony/flex": "^2.4",
"symfony/framework-bundle": "7.3.*",
"symfony/framework-bundle": "7.4.*",
"symfony/mime": "7.4.*",
"symfony/rate-limiter": "7.4.*",
"symfony/runtime": "7.4.*",
"symfony/translation": "7.3.*",
"symfony/twig-bundle": "7.3.*",
"symfony/security-bundle": "7.4.*",
"symfony/translation": "7.4.*",
"symfony/twig-bundle": "7.4.*",
"symfony/yaml": "7.4.*",
"twig/extra-bundle": "^3.10",
"twig/markdown-extra": "^3.10"
Expand Down Expand Up @@ -81,10 +88,12 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.3.*"
"require": "7.4.*"
}
},
"require-dev": {
"symfony/maker-bundle": "^1.59"
"phpunit/phpunit": "^11.5",
"symfony/maker-bundle": "^1.59",
"symfony/web-profiler-bundle": "7.4.*"
}
}
Loading