-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: drop support of php < 7, modernise code and tests, replace trav…
…is with github actions (#47) * feat: drop support of php < 8, modernise code and tests, replace travis with github actions * feat: drop support of php < 8, modernise code and tests, replace travis with github actions * feat: drop support of php < 8, modernise code and tests, replace travis with github actions * feat: drop support of php < 8, modernise code and tests, replace travis with github actions --------- Co-authored-by: Christopher Georg <christopher.georg@sr-travel.de>
- Loading branch information
1 parent
758b829
commit 0405c2b
Showing
19 changed files
with
258 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# .github/workflows/ci.yaml | ||
name: Code_Checks | ||
|
||
on: ["push", "pull_request"] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['8.0'] | ||
stability: [ prefer-stable ] | ||
include: | ||
- php: '8.0' | ||
stability: prefer-lowest | ||
symfony-version: 4.4 | ||
- php: '8.0' | ||
symfony-version: 5.4 | ||
- php: '8.1' | ||
symfony-version: 5.4 | ||
- php: '8.2' | ||
symfony-version: 5.4 | ||
- php: '8.2' | ||
symfony-version: 6.2 | ||
|
||
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} tests | ||
steps: | ||
# basically git clone | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.composer/cache/files | ||
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} | ||
|
||
# use PHP of specific version | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: pcov | ||
coverage: pcov | ||
|
||
- name: Install dependencies | ||
env: | ||
SYMFONY_REQUIRE: ${{ matrix.symfony-version }} | ||
run: | | ||
composer global config --no-plugins allow-plugins.symfony/flex true | ||
composer global require --no-progress --no-scripts --no-plugins symfony/flex | ||
composer update --no-interaction --prefer-dist --optimize-autoloader | ||
- name: Execute tests | ||
run: vendor/bin/phpunit -c ./phpunit.xml.dist ./tests --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,7 @@ Thumbs.db | |
#composer related | ||
composer.phar | ||
composer.lock | ||
vendor/ | ||
vendor/ | ||
|
||
.phpunit.result.cache | ||
code-coverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
<!-- https://phpunit.readthedocs.io/en/9.6/configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory suffix=".php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./tests</directory> | ||
</whitelist> | ||
</filter> | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./tests</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="unit"> | ||
<directory suffix=".php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> | ||
<!-- https://phpunit.readthedocs.io/en/9.6/configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.7/phpunit.xsd" | ||
backupGlobals="false" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
colors="true" | ||
bootstrap="vendor/autoload.php" | ||
> | ||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
</php> | ||
bootstrap="vendor/autoload.php"> | ||
|
||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src/</directory> | ||
</include> | ||
<exclude> | ||
<directory>./tests</directory> | ||
</exclude> | ||
<report> | ||
<html outputDirectory="code-coverage" lowUpperBound="35" highLowerBound="70"/> | ||
</report> | ||
</coverage> | ||
|
||
<php> | ||
<ini name="error_reporting" value="-1"/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="Project Test Suite"> | ||
<directory>Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<testsuites> | ||
<testsuite name="Project Test Suite"> | ||
<directory>Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">./tests/</directory> | ||
</whitelist> | ||
</filter> | ||
<logging/> | ||
|
||
<logging> | ||
<log type="coverage-html" target="code-coverage" lowUpperBound="35" highLowerBound="70"/> | ||
</logging> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.