Skip to content

Commit 0f53519

Browse files
committed
migrate travis to circle-ci
1 parent 1f6cf54 commit 0f53519

8 files changed

Lines changed: 162 additions & 115 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch: ~
5+
push:
6+
branches:
7+
- master
8+
pull_request: ~
9+
10+
jobs:
11+
12+
lint:
13+
name: Lint
14+
runs-on: 'ubuntu-latest'
15+
timeout-minutes: 5
16+
17+
steps:
18+
- name: 'Checkout'
19+
uses: actions/checkout@v2
20+
21+
- name: 'Setup PHP'
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: '8.1'
25+
26+
- name: 'Install dependencies'
27+
run: make php-cs-fixer.phar
28+
29+
- name: 'Check style'
30+
run: ./php-cs-fixer.phar fix --dry-run --no-interaction --diff
31+
32+
test:
33+
name: ${{ matrix.name }}
34+
runs-on: ${{ matrix.os }}
35+
timeout-minutes: 8
36+
continue-on-error: ${{ matrix.allow-failure == 1 }}
37+
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
include:
42+
# Lowest deps
43+
- name: 'Test lowest deps [Linux, PHP 7.4]'
44+
os: 'ubuntu-latest'
45+
php: '7.4'
46+
symfony: '4.4.*@dev'
47+
composer-flags: '--prefer-lowest'
48+
allow-unstable: true
49+
50+
# Most recent versions
51+
- name: 'Test Symfony 5.4 [Linux, PHP 8.0]'
52+
os: 'ubuntu-latest'
53+
php: '8.0'
54+
symfony: '5.4.*@dev'
55+
allow-unstable: true
56+
57+
- name: 'Test Symfony 6.0 [Linux, PHP 8.1]'
58+
os: 'ubuntu-latest'
59+
php: '8.1'
60+
symfony: '6.0.*@dev'
61+
allow-unstable: true
62+
63+
# Bleeding edge (unreleased dev versions where failures are allowed)
64+
- name: 'Test next Symfony [Linux, PHP 8.1] (allowed failure)'
65+
os: 'ubuntu-latest'
66+
php: '8.1'
67+
symfony: '6.1.*@dev'
68+
composer-flags: '--ignore-platform-req php'
69+
allow-unstable: true
70+
allow-failure: true
71+
72+
steps:
73+
- name: 'Set git to use LF'
74+
run: |
75+
git config --global core.autocrlf false
76+
git config --global core.eol lf
77+
78+
- name: 'Checkout'
79+
uses: actions/checkout@v2
80+
81+
- name: 'Setup PHP'
82+
uses: shivammathur/setup-php@v2
83+
with:
84+
php-version: ${{ matrix.php }}
85+
extensions: pdo_sqlite
86+
coverage: pcov
87+
tools: 'composer:v2,flex'
88+
89+
- name: 'Get composer cache directory'
90+
id: composer-cache
91+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
92+
93+
- name: 'Cache dependencies'
94+
uses: actions/cache@v2
95+
with:
96+
path: ${{ steps.composer-cache.outputs.dir }}
97+
key: ${{ runner.os }}-composer-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-${{ hashFiles('**/composer.json') }}-flags-${{ matrix.composer-flags }}
98+
restore-keys: ${{ runner.os }}-composer-
99+
100+
- name: 'Allow unstable packages'
101+
run: composer config minimum-stability dev
102+
if: ${{ matrix.allow-unstable }}
103+
104+
- name: 'Install dependencies'
105+
run: composer update --prefer-dist ${{ matrix.composer-flags }} --ansi
106+
env:
107+
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
108+
109+
- name: 'Run PHPUnit tests'
110+
run: vendor/bin/simple-phpunit --testdox --verbose ${{ matrix.code-coverage && '--coverage-text --coverage-clover build/logs/clover.xml' }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/vendor
22
composer.lock
3-
.php_cs.cache
3+
.php-cs-fixer.cache
4+
php-cs-fixer.phar
45
.phpunit.result.cache

.php_cs renamed to .php-cs-fixer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
])
1515
;
1616

17-
return PhpCsFixer\Config::create()
17+
return (new PhpCsFixer\Config())
1818
->setRiskyAllowed(true)
1919
->setUsingCache(true)
2020
->setFinder($finder)
2121
->setRules([
2222
'@Symfony' => true,
2323
'php_unit_namespaced' => true,
24-
'psr0' => false,
24+
'psr_autoloading' => true,
2525
'concat_space' => ['spacing' => 'one'],
2626
'phpdoc_summary' => false,
2727
'phpdoc_annotation_without_dot' => false,
@@ -30,7 +30,7 @@
3030
'ordered_imports' => true,
3131
'simplified_null_return' => false,
3232
'header_comment' => ['header' => $header],
33-
'yoda_style' => null,
33+
'yoda_style' => [],
3434
'native_function_invocation' => ['include' => ['@compiler_optimized']],
3535
'single_line_throw' => false,
3636
])

.travis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
PHP_CS_FIXER_VERSION=v3.4.0
2+
3+
php-cs-fixer.phar:
4+
wget --no-verbose https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/${PHP_CS_FIXER_VERSION}/php-cs-fixer.phar
5+
chmod +x php-cs-fixer.phar

Model/FormTree.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,19 @@ public function addChild(FormTreeNode $node)
6767

6868
/**
6969
* Set the loop back to the start
70+
*
71+
* @return void
7072
*/
73+
#[\ReturnTypeWillChange]
7174
public function rewind()
7275
{
7376
$this->position = 0;
7477
}
7578

7679
/**
7780
* Return the length of the tree
78-
*
79-
* @return int
8081
*/
81-
public function count()
82+
public function count(): int
8283
{
8384
return \count($this->nodes);
8485
}
@@ -88,6 +89,7 @@ public function count()
8889
*
8990
* @return FormTreeNode
9091
*/
92+
#[\ReturnTypeWillChange]
9193
public function current()
9294
{
9395
return $this->nodes[$this->position];
@@ -98,14 +100,18 @@ public function current()
98100
*
99101
* @return int
100102
*/
103+
#[\ReturnTypeWillChange]
101104
public function key()
102105
{
103106
return $this->position;
104107
}
105108

106109
/**
107110
* Increment current position
111+
*
112+
* @return void
108113
*/
114+
#[\ReturnTypeWillChange]
109115
public function next()
110116
{
111117
++$this->position;
@@ -116,6 +122,7 @@ public function next()
116122
*
117123
* @return int
118124
*/
125+
#[\ReturnTypeWillChange]
119126
public function valid()
120127
{
121128
return $this->offsetExists($this->position);
@@ -128,6 +135,7 @@ public function valid()
128135
*
129136
* @return bool
130137
*/
138+
#[\ReturnTypeWillChange]
131139
public function offsetExists($offset)
132140
{
133141
return isset($this->nodes[$offset]);
@@ -140,6 +148,7 @@ public function offsetExists($offset)
140148
*
141149
* @return FormTreeNode
142150
*/
151+
#[\ReturnTypeWillChange]
143152
public function offsetGet($offset)
144153
{
145154
return $this->offsetExists($offset) ? $this->nodes[$offset] : null;
@@ -150,7 +159,10 @@ public function offsetGet($offset)
150159
*
151160
* @param mixed $offset
152161
* @param mixed $value
162+
*
163+
* @return void
153164
*/
165+
#[\ReturnTypeWillChange]
154166
public function offsetSet($offset, $value)
155167
{
156168
/* Not implemented: Use addParent and addChild methods */
@@ -160,7 +172,10 @@ public function offsetSet($offset, $value)
160172
* Unset node at the given offset
161173
*
162174
* @param mixed $offset
175+
*
176+
* @return void
163177
*/
178+
#[\ReturnTypeWillChange]
164179
public function offsetUnset($offset)
165180
{
166181
/* Not implemented: FormTree nodes should not be unsetable */

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@
1616
}
1717
],
1818
"require": {
19-
"php": ">=7.1.0",
20-
"symfony/framework-bundle": "~2.8|~3.0|~4.0|~5.0|~6.0",
21-
"symfony/form": "~2.8|~3.0|~4.0|~5.0|~6.0",
22-
"symfony/property-access": "~2.8|~3.0|~4.0|~5.0|~6.0"
19+
"php": ">=7.4.0",
20+
"symfony/framework-bundle": "~4.4|~5.0|~6.0",
21+
"symfony/form": "~2.8|~3.0|~4.4|~5.0|~6.0",
22+
"symfony/property-access": "~4.4|~5.0|~6.0"
2323
},
2424
"require-dev": {
25-
"symfony/phpunit-bridge": "^5.0",
26-
"friendsofphp/php-cs-fixer": "^2.16"
25+
"symfony/phpunit-bridge": "^5.0"
2726
},
2827
"autoload": {
2928
"psr-4": {

phpunit.xml.dist

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,21 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit
4-
backupGlobals="false"
5-
backupStaticAttributes="false"
6-
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false"
12-
bootstrap="vendor/autoload.php"
13-
>
14-
<php>
15-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0&amp;max[self]=0&amp;max[total]=9999&amp;verbose=1" />
16-
</php>
17-
<testsuites>
18-
<testsuite name="ElaoFormTranslation Test Suite">
19-
<directory suffix="Test.php">./Tests/</directory>
20-
</testsuite>
21-
</testsuites>
22-
23-
<filter>
24-
<whitelist>
25-
<directory>./</directory>
26-
<exclude>
27-
<directory>./Resources</directory>
28-
<directory>./Tests</directory>
29-
<directory>./vendor</directory>
30-
</exclude>
31-
</whitelist>
32-
</filter>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory>./</directory>
6+
</include>
7+
<exclude>
8+
<directory>./Resources</directory>
9+
<directory>./Tests</directory>
10+
<directory>./vendor</directory>
11+
</exclude>
12+
</coverage>
13+
<php>
14+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0&amp;max[self]=0&amp;max[total]=9999&amp;verbose=1"/>
15+
</php>
16+
<testsuites>
17+
<testsuite name="ElaoFormTranslation Test Suite">
18+
<directory suffix="Test.php">./Tests/</directory>
19+
</testsuite>
20+
</testsuites>
3321
</phpunit>

0 commit comments

Comments
 (0)