Skip to content

Commit f65b3c2

Browse files
committed
chore: add workflows/phpunit.yml
1 parent 65b2d20 commit f65b3c2

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/phpunit.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
- uses: actions/checkout@v3
26+
27+
- name: Set up PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php-versions }}
31+
tools: composer, phive, phpunit
32+
extensions: intl, json, mbstring, gd, xdebug, xml, sqlite3, sqlsrv, oci8, pgsql
33+
coverage: xdebug
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
37+
- name: Checkout
38+
run: |
39+
pwd
40+
ls -l
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+
55+
- name: Run test suite
56+
run: |
57+
cd application/tests
58+
../../vendor/bin/phpunit --coverage-text

0 commit comments

Comments
 (0)