Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github actions support (include PHP 8 tests) #309

Merged
merged 33 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2dd26f0
Create run-tests.yml
monteiro Dec 25, 2020
4d06135
support different versions of symfony
monteiro Dec 26, 2020
60a6bb0
wip+
monteiro Dec 26, 2020
4a71f62
fix
monteiro Dec 26, 2020
f5cba4e
fix
monteiro Dec 26, 2020
3495ce0
wip
monteiro Dec 26, 2020
e108a58
fix
monteiro Dec 26, 2020
f558b4c
remove cache
monteiro Dec 26, 2020
e71506d
wip
monteiro Dec 26, 2020
fdb6bc3
fx
monteiro Dec 26, 2020
8eee740
add allowed to fail
monteiro Dec 26, 2020
a59f023
wip
monteiro Dec 26, 2020
8b4fb5c
r
monteiro Dec 26, 2020
54baaff
fix
monteiro Dec 26, 2020
31631c8
disable libxml from tests on php version 8
monteiro Dec 26, 2020
c798fd3
fix
monteiro Dec 26, 2020
ad3f3a9
add phpunit 8 for php 8
monteiro Dec 26, 2020
6974904
remove yet support for phpunit 8
monteiro Dec 26, 2020
3f7e006
allow to fail
monteiro Dec 26, 2020
38f578f
fix
monteiro Dec 26, 2020
ae0e474
allow to fail always true
monteiro Dec 26, 2020
4227571
add xdebug for coverage
monteiro Dec 26, 2020
b5c12d4
always dependencies highest
monteiro Dec 26, 2020
0cc94c4
add typehint
monteiro Dec 26, 2020
c760dca
fix
monteiro Dec 26, 2020
339be63
add symfony version to title
monteiro Dec 26, 2020
7dcdd9a
update
monteiro Dec 26, 2020
2fdc3a4
Element phpunit, attribute syntaxCheck: The attribute syntaxCheck is …
monteiro Dec 26, 2020
c572028
remove xdebug
monteiro Dec 26, 2020
582f161
add coverage
monteiro Dec 26, 2020
3248986
fix
monteiro Dec 26, 2020
a6a119e
add xdebug
monteiro Dec 26, 2020
71d8966
add env variable xdebug_mode
monteiro Dec 26, 2020
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
87 changes: 87 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: "CI"

on:
pull_request:
push:
branches:
- 'master'

env:
fail-fast: true
PHPUNIT_FLAGS: "-v"
SYMFONY_REQUIRE: ">=4.4"

jobs:
test:
name: PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }}
runs-on: 'ubuntu-latest'
continue-on-error: ${{ matrix.allowed-to-fail }}

strategy:
matrix:
php-version: ['7.2.5', '7.3', '7.4', '8.0']
variant: [normal]
dependencies: [highest]
allowed-to-fail: [true]
symfony-version: [latest]
include:
- php-version: 7.2.5
dependencies: highest
variant: normal
allowed-to-fail: false
symfony-version: latest
- php-version: '8.0'
dependencies: highest
variant: normal
allowed-to-fail: true
symfony-version: latest
- php-version: '7.4'
dependencies: highest
variant: 'symfony/symfony:"4.4.*"'
allowed-to-fail: false
symfony-version: 4.4
- php-version: '7.4'
dependencies: highest
variant: 'symfony/symfony:"5.1"'
allowed-to-fail: false
symfony-version: 5.1
steps:
- name: "Checkout code"
uses: actions/checkout@v2.3.3

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@2.7.0
with:
coverage: "none"
php-version: ${{ matrix.php-version }}
tools: composer:v2
extensions: intl, xdebug

- name: "Set composer cache directory"
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Install variant
if: matrix.variant != 'normal'
run: composer require ${{ matrix.variant }} --no-update

- name: "Install Composer dependencies (${{ matrix.dependencies }})"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist"

- name: "Install PHPUnit"
run: vendor/bin/simple-phpunit install

- name: "PHPUnit version"
run: vendor/bin/simple-phpunit --version

- name: "Run unit tests"
run: vendor/bin/phpunit --coverage-text --verbose

- name: "Run phantomjs tests"
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index.html

- name: "Run phantomjs tests ES5"
run: phantomjs Resources/js/run-qunit.js file://`pwd`/Resources/js/index-with-es5-shim.html
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Tests/Dumper/TranslationDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class TranslationDumperTest extends WebTestCase

private $dumper;

public function setUp()
public function setUp(): void
{
$container = $this->getContainer();

Expand Down
2 changes: 1 addition & 1 deletion Tests/WebTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected static function createKernel(array $options = array())
);
}

public function setUp()
public function setUp(): void
{
parent::setUp();
$this->deleteTmpDir();
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "^7.1",
"php": ">=7.2.5",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just putting what symfony composer.json has.

"symfony/framework-bundle": "~4.4|~5.0",
"symfony/finder": "~4.4|~5.0",
"symfony/console": "~4.4|~5.0",
Expand All @@ -26,7 +26,7 @@
"symfony/browser-kit": "~4.4|~5.0",
"symfony/twig-bundle": "~4.4|~5.0",
"symfony/phpunit-bridge": "^5.0",
"phpunit/phpunit": "^4.8|~5.7|~6.5"
"phpunit/phpunit": "^4.8|~5.7|~6.5|~8"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

support PHP 8

},
"replace": {
"willdurand/expose-translation-bundle": "2.5.*"
Expand Down