Skip to content

Commit c3932ea

Browse files
authored
Merge pull request #61 from LasseRafn/LasseRafn-patch-1
CI Flow
2 parents a1e8e1c + 4d7f78b commit c3932ea

File tree

15 files changed

+1124
-1027
lines changed

15 files changed

+1124
-1027
lines changed

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Test Suite
2+
3+
on:
4+
- pull_request
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
run-tests:
11+
concurrency:
12+
group: tests-${{ github.ref }}-${{ matrix.php-versions }}
13+
cancel-in-progress: true
14+
15+
strategy:
16+
matrix:
17+
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-versions }}
25+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, mysql, intl, gd, exif, iconv, imagick
26+
coverage: pcov
27+
28+
- uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 2
31+
32+
- name: Validate composer.json and composer.lock
33+
run: composer validate --strict
34+
35+
- name: Cache Composer packages
36+
id: composer-cache
37+
uses: actions/cache@v3
38+
with:
39+
path: vendor
40+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
41+
restore-keys: |
42+
${{ runner.os }}-php-
43+
44+
- name: Install dependencies
45+
run: composer install --prefer-dist --no-progress
46+
47+
- name: Run tests
48+
run: php -d pcov.enabled=1 -d memory_limit=4G vendor/bin/phpunit --coverage-clover=build/logs/clover.xml tests
49+
50+
- name: Upload Coverage
51+
env:
52+
OTTERWISE_TOKEN: ${{ secrets.OTTERWISE_TOKEN }}
53+
run: bash <(curl -s https://raw.githubusercontent.com/getOtterWise/bash-uploader/main/uploader.sh)

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ gen
55
vendor
66
.gitignore
77
build
8-
composer.lock
8+
composer.lock
9+
.phpunit.result.cache

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
"overtrue/pinyin": "^4.0"
2626
},
2727
"require-dev": {
28-
"doctrine/instantiator": "1.0.*",
29-
"phpunit/phpunit": "^6.5",
30-
"satooshi/php-coveralls": "^1.0"
28+
"phpunit/phpunit": "^8.5"
3129
},
3230
"autoload": {
3331
"psr-4": {
@@ -40,9 +38,6 @@
4038
}
4139
},
4240
"config": {
43-
"sort-packages": true,
44-
"platform": {
45-
"php": "7.0"
46-
}
41+
"sort-packages": true
4742
}
4843
}

phpunit.xml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false">
2+
<phpunit bootstrap="vendor/autoload.php"
3+
colors="true" processIsolation="false" stopOnFailure="false">
4+
125
<testsuites>
136
<testsuite name="Package Test Suite">
147
<directory suffix=".php">./tests/</directory>
@@ -24,9 +17,4 @@
2417
</exclude>
2518
</whitelist>
2619
</filter>
27-
28-
<logging>
29-
<log type="coverage-clover" target="build/logs/clover.xml"/>
30-
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
31-
</logging>
3220
</phpunit>

0 commit comments

Comments
 (0)