Skip to content

Commit a8e5234

Browse files
committed
chore: add workflows/phpunit.yml
1 parent 3dd2fc8 commit a8e5234

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/phpunit.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: PHPUnit
2+
3+
on:
4+
push:
5+
branches: [ "3.x" ]
6+
pull_request:
7+
branches: [ "3.x" ]
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
name: PHP ${{ matrix.php-versions }}
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
php-versions: [ '7.3', '7.4', '8.0', '8.1', '8.2' ]
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
28+
- name: Set up PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-versions }}
32+
tools: composer, phive, phpunit
33+
extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3, sqlsrv, oci8, pgsql
34+
coverage: xdebug
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Install
39+
run: |
40+
pwd
41+
export cwd=`pwd`
42+
composer self-update
43+
cd ..
44+
pwd
45+
ls -l
46+
git clone -b 3.x https://github.com/kenjis/ci-app-for-ci-phpunit-test.git
47+
cd ci-app-for-ci-phpunit-test
48+
rm application/tests/_ci_phpunit_test
49+
composer update --prefer-dist --no-progress
50+
mv vendor/kenjis/ci-phpunit-test vendor/kenjis/ci-phpunit-test.tmp
51+
mv "$cwd" vendor/kenjis/ci-phpunit-test
52+
php install.php
53+
git checkout -- application/tests/Bootstrap.php
54+
cd ..
55+
mv ci-app-for-ci-phpunit-test "$cwd"
56+
57+
- name: Run test suite
58+
run: |
59+
pwd
60+
ls -l
61+
vendor/bin/phpunit -c application/tests --coverage-text
62+
63+
- if: matrix.php-versions == '7.3'
64+
name: Run Coveralls
65+
continue-on-error: true
66+
run: |
67+
php vendor/bin/coveralls -v

0 commit comments

Comments
 (0)