Skip to content

Commit

Permalink
Test on different platforms (#1391)
Browse files Browse the repository at this point in the history
* Test on different platforms

* Inline matrix variants

* Update .github/workflows/test-platforms.yaml

Co-authored-by: Javier Spagnoletti <[email protected]>

* Update .github/workflows/test-platforms.yaml

Co-authored-by: Javier Spagnoletti <[email protected]>

Co-authored-by: Vincent Langlet <[email protected]>
Co-authored-by: Javier Spagnoletti <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2021
1 parent 7540ed0 commit 15dc9b2
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 2 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/test-platforms.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Test on platforms

on:
push:
branches:
- 3.x
- master
pull_request:

jobs:
test-mysql:
name: PHP 8.0 + MySQL + highest

runs-on: ubuntu-latest

continue-on-error: false

env:
DATABASE_URL: "mysql://[email protected]:3306/sonata_tests"

services:
mysql:
image: "mysql:8.0"

options: >-
--health-cmd "mysqladmin ping --silent"
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes
-e MYSQL_DATABASE=sonata_tests
ports:
- "3306:3306"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: pcov
tools: composer:v2
extensions: zip, mysqli, pdo_mysql

- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: "Install Composer dependencies (highest)"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --prefer-stable"

- name: Run Tests
run: make test

test-postgres:
name: PHP 8.0 + PostgreSQL + highest

runs-on: ubuntu-latest

continue-on-error: false

env:
DATABASE_URL: "postgresql://postgres:[email protected]:5432/postgres?serverVersion=13&charset=utf8"

services:
postgres:
image: "postgres:13"
env:
POSTGRES_PASSWORD: "postgres"

options: >-
--health-cmd "pg_isready"
ports:
- "5432:5432"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: pcov
tools: composer:v2
extensions: zip

- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: "Install Composer dependencies (highest)"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"
composer-options: "--prefer-dist --prefer-stable"

- name: Run Tests
run: make test
6 changes: 4 additions & 2 deletions tests/App/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ twig:
exception_controller: null
strict_variables: false

parameters:
env(DATABASE_URL): 'sqlite:////%kernel.cache_dir%/test_database.db'

doctrine:
dbal:
driver: pdo_sqlite
path: "%kernel.cache_dir%/test_database.db"
url: "%env(resolve:DATABASE_URL)%"
orm:
auto_generate_proxy_classes: true
auto_mapping: true
Expand Down

0 comments on commit 15dc9b2

Please sign in to comment.