Skip to content

Commit 5cd9c7b

Browse files
Chris53897Tobias Feijten
and
Tobias Feijten
authored
replace Travis with GitHub actions and bump dependencies (#414)
* feat: add github actions (replace travis) * feat: add github actions (replace travis) * feat: add github actions (replace travis) * Add JS tests to Github actions * Add return types to fix deprecations * Use SF 5.4 for actions Co-authored-by: Tobias Feijten <[email protected]>
1 parent d566005 commit 5cd9c7b

File tree

8 files changed

+111
-44
lines changed

8 files changed

+111
-44
lines changed

.github/workflows/code_checks.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# .github/workflows/code_checks.yaml
2+
name: Code_Checks
3+
4+
on: ["push", "pull_request"]
5+
6+
jobs:
7+
js-tests:
8+
name: "JS Tests"
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Install JS dependencies
15+
run: |
16+
cd Resources && npm install
17+
18+
- name: Run JS tests
19+
run: |
20+
cd Resources && npm run test
21+
phpunit:
22+
name: "PHP ${{ matrix.php }} + ${{ matrix.dependencies }} dependencies + Symfony ${{ matrix.symfony }}"
23+
runs-on: ubuntu-20.04
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
28+
dependencies: [highest]
29+
symfony: ['*']
30+
include:
31+
# Minimum supported dependencies with the oldest supported PHP version
32+
- php: '7.1'
33+
dependencies: lowest
34+
symfony: '*'
35+
36+
# Minimum supported dependencies with the latest supported PHP version
37+
- php: '8.0'
38+
dependencies: lowest
39+
symfony: '*'
40+
41+
- php: '8.0'
42+
dependencies: highest
43+
symfony: '*'
44+
45+
# Test each supported Symfony version with lowest supported PHP version
46+
- php: '7.1'
47+
dependencies: highest
48+
symfony: '3.4.*'
49+
50+
- php: '7.1'
51+
dependencies: highest
52+
symfony: '4.4.*'
53+
54+
- php: '7.2'
55+
dependencies: highest
56+
symfony: '5.4.*'
57+
58+
- php: '7.3'
59+
dependencies: highest
60+
symfony: '5.4.*'
61+
62+
- php: '7.4'
63+
dependencies: highest
64+
symfony: '5.4.*'
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v2
68+
69+
- name: Setup PHP
70+
uses: shivammathur/setup-php@v2
71+
with:
72+
php-version: ${{ matrix.php }}
73+
74+
- name: Require Symfony version
75+
if: matrix.symfony != '*'
76+
run: |
77+
composer global require --no-interaction --no-progress symfony/flex:^1.11
78+
composer config extra.symfony.require ${{ matrix.symfony }}
79+
80+
- name: Update project dependencies
81+
uses: ramsey/composer-install@v1
82+
with:
83+
dependency-versions: ${{ matrix.dependencies }}
84+
85+
- name: Cache PHPUnit
86+
uses: actions/cache@v2
87+
with:
88+
path: vendor/bin/.phpunit
89+
key: ${{ runner.os }}-phpunit-${{ matrix.php }}
90+
91+
- name: Install PHPUnit
92+
run: vendor/bin/simple-phpunit install
93+
94+
- name: Run PHPUnit tests
95+
env:
96+
SYMFONY_DEPRECATIONS_HELPER: max[self]=0
97+
run: vendor/bin/simple-phpunit -v

.travis.yml

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

Command/DumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function configure()
106106
;
107107
}
108108

109-
protected function execute(InputInterface $input, OutputInterface $output)
109+
protected function execute(InputInterface $input, OutputInterface $output): int
110110
{
111111
if(!in_array($input->getOption('format'), array('js', 'json'))) {
112112
$output->writeln('<error>Invalid format specified. Use js or json.</error>');

Command/RouterDebugExposedCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function configure()
7676
/**
7777
* @see Command
7878
*/
79-
protected function execute(InputInterface $input, OutputInterface $output)
79+
protected function execute(InputInterface $input, OutputInterface $output): int
8080
{
8181
if ($name = $input->getArgument('name')) {
8282
/** @var Route $route */

Serializer/Denormalizer/RouteCollectionDenormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class RouteCollectionDenormalizer implements DenormalizerInterface
1919
{
2020
/**
2121
* {@inheritDoc}
22+
* @return mixed
2223
*/
2324
public function denormalize($data, $class, $format = null, array $context = array())
2425
{
@@ -43,7 +44,7 @@ public function denormalize($data, $class, $format = null, array $context = arra
4344
/**
4445
* {@inheritDoc}
4546
*/
46-
public function supportsDenormalization($data, $type, $format = null)
47+
public function supportsDenormalization($data, $type, $format = null): bool
4748
{
4849
if (!is_array($data)) {
4950
return false;

Serializer/Normalizer/RouteCollectionNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class RouteCollectionNormalizer implements NormalizerInterface
2121
{
2222
/**
2323
* {@inheritDoc}
24+
* @return array|string|int|float|bool|\ArrayObject|null
2425
*/
2526
public function normalize($data, $format = null, array $context = array())
2627
{
@@ -45,7 +46,7 @@ public function normalize($data, $format = null, array $context = array())
4546
/**
4647
* {@inheritDoc}
4748
*/
48-
public function supportsNormalization($data, $format = null)
49+
public function supportsNormalization($data, $format = null): bool
4950
{
5051
return $data instanceof RouteCollection;
5152
}

Serializer/Normalizer/RoutesResponseNormalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class RoutesResponseNormalizer implements NormalizerInterface
2121
{
2222
/**
2323
* {@inheritdoc}
24+
* @return array|string|int|float|bool|\ArrayObject|null
2425
*/
2526
public function normalize($data, $format = null, array $context = array())
2627
{
@@ -38,7 +39,7 @@ public function normalize($data, $format = null, array $context = array())
3839
/**
3940
* {@inheritDoc}
4041
*/
41-
public function supportsNormalization($data, $format = null)
42+
public function supportsNormalization($data, $format = null): bool
4243
{
4344
return $data instanceof RoutesResponse;
4445
}

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
],
1818
"require": {
1919
"php": "^7.1|^8.0",
20-
"symfony/framework-bundle": "~3.3|^4.0|^5.0",
21-
"symfony/serializer": "~3.3|^4.0|^5.0",
22-
"symfony/console": "~3.3|^4.0|^5.0",
23-
"willdurand/jsonp-callback-validator": "~1.0"
20+
"symfony/framework-bundle": "~3.4|^4.4.20|^5.0",
21+
"symfony/serializer": "~3.4|^4.4.20|^5.0",
22+
"symfony/console": "~3.4|^4.4.20|^5.0",
23+
"willdurand/jsonp-callback-validator": "~1.1"
2424
},
2525
"require-dev": {
26-
"symfony/expression-language": "~3.3|^4.0|^5.0",
27-
"symfony/phpunit-bridge": "^5.1"
26+
"symfony/expression-language": "~3.4|^4.4.20|^5.0",
27+
"symfony/phpunit-bridge": "^5.3"
2828
},
2929
"autoload": {
3030
"psr-4": { "FOS\\JsRoutingBundle\\": "" },

0 commit comments

Comments
 (0)