-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from BaguettePHP/feature/ci-phpunit
Set CI and update PHPUnit
- Loading branch information
Showing
7 changed files
with
87 additions
and
81 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,51 @@ | ||
name: Test | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**.md' | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**.md' | ||
jobs: | ||
run: | ||
name: Run | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
operating-system: [ubuntu-20.04] | ||
php-versions: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] | ||
env: | ||
key: cache-v1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup PHP with tools | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, intl, opcache, xdebug, xml | ||
tools: composer, cs2pr | ||
- name: Get Composer cache directory | ||
id: composer-cache-dir | ||
run: | | ||
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
- name: Restore composer cache | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Remove composer.lock | ||
run: rm -f composer.lock | ||
- name: Setup Composer | ||
run: composer install | ||
- name: Run PHPUnit tests | ||
run: vendor/bin/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 |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
/vendor/* | ||
/.idea | ||
/*.iml | ||
/.phpunit.result.cache |
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,7 +14,7 @@ Description | |
Requirements | ||
------------ | ||
|
||
* PHP (5.4+) | ||
* PHP (5.5+) | ||
* `ext/intl` | ||
|
||
Installation | ||
|
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/3.7/phpunit.xsd" | ||
bootstrap="./tests/bootstrap.php"> | ||
<testsuites> | ||
<testsuite> | ||
<directory>./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">./src/</directory> | ||
</whitelist> | ||
<blacklist> | ||
<directory suffix=".php">./vendor/</directory> | ||
</blacklist> | ||
<exclude></exclude> | ||
</filter> | ||
<logging> | ||
<log type="coverage-html" target="build/report/coverage" /> | ||
<log type="coverage-clover" target="build/logs/clover.xml" /> | ||
</logging> | ||
|
||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
bootstrap="tests/bootstrap.php" | ||
> | ||
<testsuites> | ||
<testsuite name="HTTP Accept-Language"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist processUncoveredFilesFromWhitelist="true"> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
</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