-
Notifications
You must be signed in to change notification settings - Fork 63
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 #142 from kohlerdominik/ci-test
Migrate automated test to Github Actions
- Loading branch information
Showing
5 changed files
with
87 additions
and
59 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
linux_tests: | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['8.0', '8.1', '8.2'] | ||
stability: ['prefer-lowest', 'prefer-stable'] | ||
exclude: | ||
# Nesbot/Carbon in the lowest version is not fully compatible | ||
- php: 8.2 | ||
stability: 'prefer-lowest' | ||
|
||
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mbstring, dom, fileinfo | ||
tools: composer:v2 | ||
coverage: none | ||
|
||
- name: Check for syntax errors in PHP files | ||
run: find ./ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l | ||
|
||
- name: Check composer files | ||
run: composer validate --strict | ||
|
||
- name: Lock PhpUnit Version | ||
run: composer require --dev phpunit/phpunit:^9.0 --no-install --no-interaction --no-progress | ||
|
||
- name: Install dependencies | ||
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress | ||
|
||
- name: Execute tests in default environment | ||
run: vendor/bin/phpunit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit cacheTokens="false" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
verbose="true"> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
stopOnError="false" | ||
stopOnFailure="false" | ||
stopOnIncomplete="false" | ||
stopOnSkipped="false" | ||
verbose="true" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" | ||
> | ||
<!-- | ||
<coverage> | ||
<include> | ||
<directory>./src/</directory> | ||
</include> | ||
<exclude> | ||
<directory>./vendor/</directory> | ||
</exclude> | ||
<report> | ||
<clover outputFile="build/logs/clover.xml"/> | ||
<html outputDirectory="build/coverage"/> | ||
</report> | ||
</coverage> | ||
--> | ||
<testsuites> | ||
<testsuite name="Application Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<logging> | ||
<log type="coverage-html" target="build/coverage"/> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
<log type="junit" target="build/logs/junit.xml"/> | ||
<junit outputFile="build/logs/junit.xml"/> | ||
</logging> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory>./src/</directory> | ||
<exclude> | ||
<directory>./vendor/</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
<php> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="QUEUE_DRIVER" value="sync"/> | ||
</php> | ||
</phpunit> | ||
</phpunit> |