Skip to content

Commit

Permalink
Merge pull request #61 from LasseRafn/LasseRafn-patch-1
Browse files Browse the repository at this point in the history
CI Flow
  • Loading branch information
LasseRafn committed Jul 26, 2023
2 parents a1e8e1c + 4d7f78b commit c3932ea
Show file tree
Hide file tree
Showing 15 changed files with 1,124 additions and 1,027 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Test Suite

on:
- pull_request

permissions:
contents: read

jobs:
run-tests:
concurrency:
group: tests-${{ github.ref }}-${{ matrix.php-versions }}
cancel-in-progress: true

strategy:
matrix:
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']

runs-on: ubuntu-latest

steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, mysql, intl, gd, exif, iconv, imagick
coverage: pcov

- uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: php -d pcov.enabled=1 -d memory_limit=4G vendor/bin/phpunit --coverage-clover=build/logs/clover.xml tests

- name: Upload Coverage
env:
OTTERWISE_TOKEN: ${{ secrets.OTTERWISE_TOKEN }}
run: bash <(curl -s https://raw.githubusercontent.com/getOtterWise/bash-uploader/main/uploader.sh)
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ gen
vendor
.gitignore
build
composer.lock
composer.lock
.phpunit.result.cache
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"overtrue/pinyin": "^4.0"
},
"require-dev": {
"doctrine/instantiator": "1.0.*",
"phpunit/phpunit": "^6.5",
"satooshi/php-coveralls": "^1.0"
"phpunit/phpunit": "^8.5"
},
"autoload": {
"psr-4": {
Expand All @@ -40,9 +38,6 @@
}
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.0"
}
"sort-packages": true
}
}
18 changes: 3 additions & 15 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<phpunit bootstrap="vendor/autoload.php"
colors="true" processIsolation="false" stopOnFailure="false">

<testsuites>
<testsuite name="Package Test Suite">
<directory suffix=".php">./tests/</directory>
Expand All @@ -24,9 +17,4 @@
</exclude>
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>

0 comments on commit c3932ea

Please sign in to comment.