Skip to content

Commit

Permalink
Merge pull request #142 from kohlerdominik/ci-test
Browse files Browse the repository at this point in the history
Migrate automated test to Github Actions
  • Loading branch information
gcphost authored Aug 16, 2023
2 parents 18f361c + c87f31e commit db95b6d
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 59 deletions.
4 changes: 0 additions & 4 deletions .codacy.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
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
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
}
],
"require": {
"php": "^7.2.5|^8.0",
"illuminate/support": "^7.0|^8.0|^9.0|^10.0",
"illuminate/container": "^7.0|^8.0|^9.0|^10.0",
"illuminate/database": "^7.0|^8.0|^9.0|^10.0",
"illuminate/events": "^7.0|^8.0|^9.0|^10.0"
"php": "^8.0",
"illuminate/support": "^9.0|^10.0",
"illuminate/container": "^9.0|^10.0",
"illuminate/database": "^9.0|^10.0",
"illuminate/events": "^9.0|^10.0"
},
"require-dev": {
"phpunit/phpunit": "^8.4|^9.0",
"orchestra/testbench": "^5.0|^6.0|^7.0",
"codacy/coverage": "dev-master"
"phpunit/phpunit": "^9.0|^10.0",
"orchestra/testbench": "^6.0|^7.0|^8.0"
},
"autoload": {
"psr-4": {
Expand Down
57 changes: 31 additions & 26 deletions phpunit.xml
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>

0 comments on commit db95b6d

Please sign in to comment.