File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on :
4+ push :
5+ branches : [master, main]
6+ pull_request :
7+ branches : [master, main]
8+
9+ jobs :
10+ test :
11+ runs-on : ubuntu-latest
12+
13+ strategy :
14+ fail-fast : false
15+ matrix :
16+ php : ['8.1', '8.2', '8.3']
17+
18+ name : PHP ${{ matrix.php }}
19+
20+ steps :
21+ - name : Checkout code
22+ uses : actions/checkout@v4
23+
24+ - name : Setup PHP
25+ uses : shivammathur/setup-php@v2
26+ with :
27+ php-version : ${{ matrix.php }}
28+ extensions : swoole, json, mbstring, pcntl
29+ coverage : none
30+ tools : composer:v2
31+
32+ - name : Get Composer cache directory
33+ id : composer-cache
34+ run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
35+
36+ - name : Cache Composer dependencies
37+ uses : actions/cache@v4
38+ with :
39+ path : ${{ steps.composer-cache.outputs.dir }}
40+ key : ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
41+ restore-keys : |
42+ ${{ runner.os }}-php-${{ matrix.php }}-composer-
43+
44+ - name : Install dependencies
45+ run : composer install --prefer-dist --no-progress --no-interaction
46+
47+ - name : Run tests
48+ run : vendor/bin/phpunit --colors=always
49+
50+ code-style :
51+ runs-on : ubuntu-latest
52+ name : Code Style
53+
54+ steps :
55+ - name : Checkout code
56+ uses : actions/checkout@v4
57+
58+ - name : Setup PHP
59+ uses : shivammathur/setup-php@v2
60+ with :
61+ php-version : ' 8.2'
62+ tools : composer:v2
63+
64+ - name : Install dependencies
65+ run : composer install --prefer-dist --no-progress --no-interaction
66+
67+ - name : Check syntax
68+ run : find src -name "*.php" -exec php -l {} \; | grep -v "No syntax errors"
You can’t perform that action at this time.
0 commit comments