Skip to content

Commit 91b6617

Browse files
author
Florian Krämer
committed
Adding GH Actions
1 parent 920b6d1 commit 91b6617

File tree

2 files changed

+93
-27
lines changed

2 files changed

+93
-27
lines changed

config/.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
testsuite:
7+
name: Unittests
8+
runs-on: ubuntu-20.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php-version: ['7.4', '8.0']
13+
14+
steps:
15+
- uses: actions/checkout@v1
16+
with:
17+
fetch-depth: 1
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '7.4'
23+
extensions: mbstring, json, fileinfo
24+
tools: pecl
25+
coverage: pcov
26+
27+
- name: Composer install
28+
run: |
29+
if [[ ${{ matrix.prefer-lowest == 'prefer-lowest' }} ]]; then
30+
composer update --prefer-lowest --prefer-stable
31+
else
32+
composer install
33+
fi
34+
35+
- name: Phive install
36+
run: php config/composer_phive.php
37+
38+
- name: Run PHPUnit
39+
run: |
40+
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
41+
bin/phpunit --coverage-clover=coverage.xml
42+
else
43+
bin/phpunit
44+
fi
45+
46+
- name: Code Coverage Report
47+
if: success() && matrix.php-version == '7.4'
48+
uses: codecov/codecov-action@v1
49+
50+
cs-stan:
51+
name: Coding Standard & Static Analysis
52+
runs-on: ubuntu-20.04
53+
54+
steps:
55+
- uses: actions/checkout@v1
56+
with:
57+
fetch-depth: 1
58+
59+
- name: Setup PHP
60+
uses: shivammathur/setup-php@v2
61+
with:
62+
php-version: '7.4'
63+
extensions: mbstring, json, fileinfo
64+
coverage: none
65+
tools: pecl
66+
67+
- name: Composer install
68+
run: composer update --prefer-lowest --prefer-stable
69+
70+
- name: Phive install
71+
run: php config/composer_phive.php
72+
73+
- name: Run phpcs
74+
run: bin/phpcs --version && bin/phpcs --report=checkstyle --standard=phpcs.xml src/ tests/
75+
76+
- name: Run phpstan
77+
run: bin/phpstan -V && bin/phpstan analyse src -l 5 --error-format=github

phpunit.xml

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="tests\bootstrap.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
verbose="true"
12-
>
13-
<testsuites>
14-
<testsuite name="Email">
15-
<directory suffix="Test.php">./tests/</directory>
16-
</testsuite>
17-
</testsuites>
18-
<filter>
19-
<whitelist>
20-
<directory suffix=".php">./src/</directory>
21-
</whitelist>
22-
</filter>
23-
<!--
24-
<logging>
25-
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
26-
<log type="coverage-clover" target="coverage.xml" showUncoveredFiles="true"/>
27-
</logging>
28-
-->
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="tests/bootstrap.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" verbose="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage>
4+
<include>
5+
<directory suffix=".php">./src/</directory>
6+
</include>
7+
<report>
8+
<clover outputFile="coverage.xml"/>
9+
<text outputFile="php://stdout" showUncoveredFiles="true"/>
10+
</report>
11+
</coverage>
12+
<testsuites>
13+
<testsuite name="Phauthentic">
14+
<directory suffix="Test.php">./tests/</directory>
15+
</testsuite>
16+
</testsuites>
17+
<logging/>
2918
</phpunit>

0 commit comments

Comments
 (0)