Skip to content

Commit ad5c7a7

Browse files
authored
Merge pull request #2 from LordSimal/main
add github CI for PHPUnit Tests
2 parents 714e7f6 + c0b32c3 commit ad5c7a7

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.github/workflows/ci.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch: # allows you to manually dispatch a workflow run via Github UI
11+
12+
permissions:
13+
contents: read # to fetch code (actions/checkout)
14+
15+
jobs:
16+
testsuite-linux:
17+
runs-on: ubuntu-22.04
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php-version: [ '8.1', '8.2', '8.3' ]
22+
dependencies: ['highest']
23+
include:
24+
- php-version: '8.1'
25+
dependencies: 'lowest'
26+
- php-version: '8.3'
27+
dependencies: 'highest'
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Setup PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ matrix.php-version }}
36+
extensions: mbstring, intl
37+
ini-values: zend.assertions=1
38+
coverage: pcov
39+
40+
- name: Composer install
41+
uses: ramsey/composer-install@v2
42+
with:
43+
dependency-versions: ${{ matrix.dependencies }}
44+
composer-options: ${{ matrix.composer-options }}
45+
46+
- name: Run PHPUnit
47+
run: |
48+
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
49+
vendor/bin/phpunit --coverage-clover=coverage.xml
50+
else
51+
vendor/bin/phpunit
52+
fi

composer.json

+3
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
"Cors\\Test\\": "tests",
2323
"Cake\\Test\\": "./vendor/cakephp/cakephp/tests"
2424
}
25+
},
26+
"scripts": {
27+
"test": "phpunit"
2528
}
2629
}

0 commit comments

Comments
 (0)