Skip to content

Commit c612690

Browse files
Add support for PHP 8 (#30)
* Add support for PHP 8 * Migrate to GitHub Actions * Add review
1 parent 9d01e00 commit c612690

File tree

4 files changed

+87
-73
lines changed

4 files changed

+87
-73
lines changed

.github/workflows/ci.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI
2+
3+
on:
4+
schedule:
5+
- cron: 0 2 * * 1-5
6+
pull_request:
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
tests:
13+
name: Tests PHP ${{ matrix.php }} ${{ matrix.dependency }} (Symfony ${{ matrix.symfony }})
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
php:
18+
- '5.5'
19+
- '5.6'
20+
- '7.0'
21+
- '7.1'
22+
- '7.2'
23+
- '7.3'
24+
- '7.4'
25+
- '8.0'
26+
symfony:
27+
- '3.4.*'
28+
- '4.4.*'
29+
- '5.0.*'
30+
include:
31+
- php: '7.1'
32+
coverage: true
33+
dependency:
34+
- ''
35+
- 'lowest'
36+
fail-fast: false
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v1
40+
41+
- name: Setup PHP
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: ${{ matrix.php }}
45+
extensions: curl, dom, iconv, intl, json, libxml, mbstring, phar, tokenizer, xdebug, xml, xmlwriter
46+
47+
- name: Get Composer Cache Directory
48+
id: composer-cache
49+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
50+
51+
- name: Cache dependencies
52+
uses: actions/cache@v1
53+
with:
54+
path: ${{ steps.composer-cache.outputs.dir }}
55+
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
56+
restore-keys: ${{ matrix.php }}-composer-
57+
58+
- name: Configure Symfony
59+
run: |
60+
composer global require symfony/flex
61+
composer config extra.symfony.require "${{ matrix.symfony }}"
62+
63+
- name: Update project dependencies
64+
if: matrix.dependency == ''
65+
run: composer update --no-progress --ansi --prefer-stable
66+
67+
- name: Update project dependencies lowest
68+
if: matrix.dependency == 'lowest'
69+
run: composer update --no-progress --ansi --prefer-stable --prefer-lowest
70+
71+
- name: Validate composer
72+
run: composer validate --strict --no-check-lock
73+
74+
- name: Run tests
75+
if: !matrix.coverage
76+
run: vendor/bin/phpunit
77+
78+
- name: Run tests with coverage
79+
if: matrix.coverage
80+
run: vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml
81+
82+
- name: Upload coverage
83+
if: matrix.coverage
84+
run: |
85+
wget https://scrutinizer-ci.com/ocular.phar
86+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

.styleci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@ finder:
55
- "Resources"
66
- "vendor"
77

8-
enabled:
9-
- short_array_syntax
10-
118
disabled:
129
- phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198

.travis.yml

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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^5.5 || ^7.0",
13+
"php": "^5.5 || ^7.0 || ^8.0",
1414
"symfony/dependency-injection": "^3.4 || ^4.3 || ^5.0",
1515
"symfony/framework-bundle": "^3.4 || ^4.3 || ^5.0",
1616
"symfony/http-kernel": "^3.4 || ^4.3 || ^5.0",

0 commit comments

Comments
 (0)