Skip to content

Commit 7ff17a1

Browse files
committed
CI
1 parent 7aee1a3 commit 7ff17a1

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: UnitTest
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
10+
experimental: [ false ]
11+
include:
12+
- php-versions: '8.5'
13+
experimental: true
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
# PHP
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
- name: Get composer cache directory
23+
id: composercache
24+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
25+
- name: Cache composer dependencies
26+
uses: actions/cache@v4
27+
with:
28+
path: ${{ steps.composercache.outputs.dir }}
29+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
30+
restore-keys: ${{ runner.os }}-composer-
31+
- name: Install dependencies
32+
run: composer update --prefer-dist --prefer-stable --no-progress --no-suggest
33+
34+
- name: Run test suite
35+
run: php vendor/bin/phpunit --configuration phpunit.ci.xml

phpunit.ci.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php">
3+
<php>
4+
<ini name="error_reporting" value="-1" />
5+
</php>
6+
<testsuites>
7+
<testsuite name="Unit">
8+
<directory>tests</directory>
9+
</testsuite>
10+
</testsuites>
11+
</phpunit>

0 commit comments

Comments
 (0)