Skip to content

Commit

Permalink
Integrate GitHub CI and bump Symfony requirement (#24)
Browse files Browse the repository at this point in the history
* Setup GitHub CI

* AbstractListener was introduced in Symfony 4.4.1

See: symfony/symfony@b20ebe6
  • Loading branch information
jmikola committed Jun 16, 2021
1 parent 2b64d85 commit 6138b92
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 12 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Tests"

on: [push, pull_request]

jobs:
phpunit:
name: "PHPUnit tests"
runs-on: "ubuntu-20.04"

strategy:
fail-fast: true
matrix:
php: ["7.1", "8.0"]
include:
- php: "7.1"
composer-args: "--prefer-lowest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
coverage: "none"

- name: "Cache composer dependencies"
uses: "actions/cache@v2"
with:
path: "~/.composer/cache"
key: "${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "${{ matrix.php }}-composer-"

- name: "Cache phpunit dependencies"
uses: "actions/cache@v2"
with:
path: "./vendor/bin/.phpunit"
key: "${{ matrix.php }}-phpunit-${{ hashFiles('**/composer.lock') }}"
restore-keys: "${{ matrix.php }}-phpunit-"

- name: "Install dependencies"
run: |
echo "::group::composer update"
composer update --no-interaction --no-progress ${{ matrix.composer-args }}
echo "::endgroup::"
echo "::group::install phpunit"
./vendor/bin/simple-phpunit install
echo "::endgroup::"
- name: "Run PHPUnit"
run: "./vendor/bin/simple-phpunit -v"
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"psr/log": "^1.0",
"symfony/event-dispatcher": "^4.4 || ^5.0",
"symfony/http-kernel": "^4.4 || ^5.0",
"symfony/security": "^4.4 || ^5.0"
"symfony/security": "^4.4.1 || ^5.0"
},
"autoload": {
"psr-4": { "Jmikola\\AutoLogin\\": "src/" }
},
"autoload-dev": {
"psr-4": { "Jmikola\\AutoLogin\\Tests\\": "Tests/" }
"psr-4": { "Jmikola\\AutoLogin\\Tests\\": "tests/" }
},
"extra": {
"branch-alias": {
Expand All @@ -31,6 +31,6 @@
"symfony/phpunit-bridge": "^5.2"
},
"scripts": {
"test": "./vendor/bin/simple-phpunit Tests/*"
"test": "./vendor/bin/simple-phpunit"
}
}
22 changes: 13 additions & 9 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
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"
/>
>
<php>
<ini name="error_reporting" value="-1"/>
</php>

<testsuites>
<testsuite name="Default Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 6138b92

Please sign in to comment.