Skip to content

Commit 6138b92

Browse files
authored
Integrate GitHub CI and bump Symfony requirement (#24)
* Setup GitHub CI * AbstractListener was introduced in Symfony 4.4.1 See: symfony/symfony@b20ebe6
1 parent 2b64d85 commit 6138b92

File tree

4 files changed

+68
-12
lines changed

4 files changed

+68
-12
lines changed

.github/workflows/tests.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Tests"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
phpunit:
7+
name: "PHPUnit tests"
8+
runs-on: "ubuntu-20.04"
9+
10+
strategy:
11+
fail-fast: true
12+
matrix:
13+
php: ["7.1", "8.0"]
14+
include:
15+
- php: "7.1"
16+
composer-args: "--prefer-lowest"
17+
18+
steps:
19+
- name: "Checkout"
20+
uses: "actions/checkout@v2"
21+
22+
- name: "Install PHP"
23+
uses: "shivammathur/setup-php@v2"
24+
with:
25+
php-version: "${{ matrix.php }}"
26+
coverage: "none"
27+
28+
- name: "Cache composer dependencies"
29+
uses: "actions/cache@v2"
30+
with:
31+
path: "~/.composer/cache"
32+
key: "${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}"
33+
restore-keys: "${{ matrix.php }}-composer-"
34+
35+
- name: "Cache phpunit dependencies"
36+
uses: "actions/cache@v2"
37+
with:
38+
path: "./vendor/bin/.phpunit"
39+
key: "${{ matrix.php }}-phpunit-${{ hashFiles('**/composer.lock') }}"
40+
restore-keys: "${{ matrix.php }}-phpunit-"
41+
42+
- name: "Install dependencies"
43+
run: |
44+
echo "::group::composer update"
45+
composer update --no-interaction --no-progress ${{ matrix.composer-args }}
46+
echo "::endgroup::"
47+
echo "::group::install phpunit"
48+
./vendor/bin/simple-phpunit install
49+
echo "::endgroup::"
50+
51+
- name: "Run PHPUnit"
52+
run: "./vendor/bin/simple-phpunit -v"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"psr/log": "^1.0",
1515
"symfony/event-dispatcher": "^4.4 || ^5.0",
1616
"symfony/http-kernel": "^4.4 || ^5.0",
17-
"symfony/security": "^4.4 || ^5.0"
17+
"symfony/security": "^4.4.1 || ^5.0"
1818
},
1919
"autoload": {
2020
"psr-4": { "Jmikola\\AutoLogin\\": "src/" }
2121
},
2222
"autoload-dev": {
23-
"psr-4": { "Jmikola\\AutoLogin\\Tests\\": "Tests/" }
23+
"psr-4": { "Jmikola\\AutoLogin\\Tests\\": "tests/" }
2424
},
2525
"extra": {
2626
"branch-alias": {
@@ -31,6 +31,6 @@
3131
"symfony/phpunit-bridge": "^5.2"
3232
},
3333
"scripts": {
34-
"test": "./vendor/bin/simple-phpunit Tests/*"
34+
"test": "./vendor/bin/simple-phpunit"
3535
}
3636
}

phpunit.xml.dist

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
23
<phpunit
34
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
backupGlobals="false"
5-
backupStaticAttributes="false"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
66
colors="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false"
127
bootstrap="vendor/autoload.php"
13-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
14-
/>
8+
>
9+
<php>
10+
<ini name="error_reporting" value="-1"/>
11+
</php>
12+
13+
<testsuites>
14+
<testsuite name="Default Test Suite">
15+
<directory>./tests/</directory>
16+
</testsuite>
17+
</testsuites>
18+
</phpunit>
File renamed without changes.

0 commit comments

Comments
 (0)