Skip to content

Commit 523cc0b

Browse files
committed
add action phpunit
1 parent cf7c45a commit 523cc0b

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/tests.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
phpunit:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php-versions: ['8.0', '8.1']
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-versions }}
25+
extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, exif
26+
coverage: xdebug
27+
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate
31+
32+
- name: Cache Composer packages
33+
id: composer-cache
34+
uses: actions/cache@v2
35+
with:
36+
path: vendor
37+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-php-
40+
41+
- name: Install dependencies
42+
if: steps.composer-cache.outputs.cache-hit != 'true'
43+
run: |
44+
composer install
45+
composer dump
46+
47+
- name: Run test phpunit
48+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)