@@ -2,88 +2,8 @@ name: PHPUnit
22
33on :
44 pull_request :
5- branches :
6- - develop
7- paths :
8- - ' **.php'
9- - ' composer.*'
10- - ' phpunit*'
11- - ' .github/workflows/phpunit.yml'
125 push :
13- branches :
14- - develop
15- paths :
16- - ' **.php'
17- - ' composer.*'
18- - ' phpunit*'
19- - ' .github/workflows/phpunit.yml'
206
217jobs :
22- main :
23- name : PHP ${{ matrix.php-versions }} Unit Tests
24- runs-on : ubuntu-latest
25- if : " !contains(github.event.head_commit.message, '[ci skip]')"
26- strategy :
27- matrix :
28- php-versions : ['7.4', '8.0', '8.1', '8.2']
29-
30- steps :
31- - name : Checkout
32- uses : actions/checkout@v3
33-
34- - name : Set up PHP
35- uses : shivammathur/setup-php@v2
36- with :
37- php-version : ${{ matrix.php-versions }}
38- tools : composer, phive, phpunit
39- extensions : intl, json, mbstring, gd, xdebug, xml, sqlite3
40- coverage : xdebug
41- env :
42- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43-
44- - name : Get composer cache directory
45- run : echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV
46-
47- - name : Cache composer dependencies
48- uses : actions/cache@v3
49- with :
50- path : ${{ env.COMPOSER_CACHE_FILES_DIR }}
51- key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }}
52- restore-keys : ${{ runner.os }}-composer-
53-
54- - name : Install dependencies
55- run : |
56- if [ -f composer.lock ]; then
57- composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader
58- else
59- composer update --no-progress --no-interaction --prefer-dist --optimize-autoloader
60- fi
61-
62- - name : Test with PHPUnit
63- run : vendor/bin/phpunit --verbose --coverage-text
64- env :
65- TERM : xterm-256color
66- TACHYCARDIA_MONITOR_GA : enabled
67-
68- - if : matrix.php-versions == '8.1'
69- name : Run Coveralls
70- continue-on-error : true
71- run : |
72- sudo phive --no-progress install --global --trust-gpg-keys E82B2FB314E9906E php-coveralls
73- php-coveralls --verbose --coverage_clover=build/phpunit/clover.xml --json_path build/phpunit/coveralls-upload.json
74- env :
75- COVERALLS_REPO_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76- COVERALLS_PARALLEL : true
77- COVERALLS_FLAG_NAME : PHP ${{ matrix.php-versions }}
78-
79- coveralls :
80- needs : [main]
81- name : Coveralls Finished
82- runs-on : ubuntu-latest
83- steps :
84- - name : Upload Coveralls results
85- uses : coverallsapp/github-action@master
86- continue-on-error : true
87- with :
88- github-token : ${{ secrets.GITHUB_TOKEN }}
89- parallel-finished : true
8+ phpunit :
9+ uses : codeigniter4/.github/.github/workflows/phpunit.yml@main
0 commit comments