@@ -2,7 +2,12 @@ name: PHPUnit for MQTT
22
33on :
44 push :
5+ branches :
6+ - master
7+ - ci
58 pull_request :
9+ branches :
10+ - master
611 schedule :
712 - cron : ' 11 2 * * 1'
813
@@ -11,77 +16,26 @@ concurrency:
1116 cancel-in-progress : true
1217
1318jobs :
14- linux :
15- name : PHP${{ matrix.php-version }} Swoole-${{ matrix.swoole-version }} Test on Linux
16- runs-on : " ${{ matrix.os }}"
19+ test :
20+ name : PHP${{ matrix.php-version }} Swoole-${{ matrix.swoole-version }} Test on ${{ matrix.os }}
21+ runs-on : ${{ matrix.os }}
1722 strategy :
1823 matrix :
19- os : [ ubuntu-latest ]
20- php-version : [ '8.0', '8.1', '8.2', '8.3' ]
21- swoole-version : [ 'v4.8.13', 'v5.1.5 ', 'master' ]
24+ os : [ubuntu-latest, macos-latest ]
25+ php-version : [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
26+ swoole-version : [ 'v4.8.13', 'v5.1.6', 'v6.0.0 ', 'master' ]
2227 exclude :
23- - php-version : ' 8.3'
28+ - php-version : ' 8.4'
29+ swoole-version : ' v5.1.6'
30+ - php-version : ' 8.4'
2431 swoole-version : ' v4.8.13'
25- - php-version : ' 8.0'
26- swoole-version : ' master'
27- max-parallel : 15
28- fail-fast : false
29- env :
30- SWOOLE_VERSION : ${{ matrix.swoole-version }}
31- steps :
32- - name : Checkout
33- uses : actions/checkout@v4
34-
35- - name : Setup PHP
36- uses : shivammathur/setup-php@v2
37- with :
38- php-version : ${{ matrix.php-version }}
39- tools : phpize
40- ini-values : extension=swoole
41- coverage : none
42-
43- - name : Build Swoole
44- run : |
45- wget https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
46- mkdir -p swoole
47- tar -xf swoole.tar.gz -C swoole --strip-components=1
48- rm swoole.tar.gz
49- cd swoole
50- phpize
51- ./configure --enable-openssl --enable-mysqlnd --enable-http2
52- make -j$(nproc)
53- sudo make install
54- php --ri swoole
55-
56- - name : Setup Dependencies
57- env :
58- COMPOSER_ROOT_VERSION : 1.x-dev
59- run :
60- composer install -o
61-
62- - name : Coding Standards Check
63- if : matrix.php-version == '8.1'
64- run : |
65- composer cs-check
66-
67- - name : Run Test Cases
68- run : |
69- composer test
70-
71- macos :
72- name : PHP${{ matrix.php-version }} Swoole-${{ matrix.swoole-version }} Test on macOS
73- runs-on : " ${{ matrix.os }}"
74- strategy :
75- matrix :
76- os : [ macos-latest ]
77- php-version : [ '8.0', '8.1', '8.2', '8.3' ]
78- swoole-version : [ 'v4.8.13', 'v5.1.5', 'master' ]
79- exclude :
8032 - php-version : ' 8.3'
8133 swoole-version : ' v4.8.13'
34+ - php-version : ' 8.0'
35+ swoole-version : ' v6.0.0'
8236 - php-version : ' 8.0'
8337 swoole-version : ' master'
84- max-parallel : 15
38+ max-parallel : 10
8539 fail-fast : false
8640 env :
8741 SWOOLE_VERSION : ${{ matrix.swoole-version }}
@@ -99,29 +53,39 @@ jobs:
9953
10054 - name : Build Swoole
10155 run : |
102- export CPPFLAGS="$CPPFLAGS -I$(brew --prefix pcre2)/include -L$(brew --prefix pcre2)/lib"
103- wget https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
104- mkdir -p swoole
105- tar -xf swoole.tar.gz -C swoole --strip-components=1
106- rm swoole.tar.gz
107- cd swoole
108- phpize
109- ./configure --enable-openssl --with-openssl-dir=$(brew --prefix openssl) --enable-mysqlnd --enable-http2
110- make -j$(sysctl -n hw.logicalcpu)
111- sudo make install
112- php --ri swoole
56+ if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
57+ wget https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
58+ mkdir -p swoole
59+ tar -xf swoole.tar.gz -C swoole --strip-components=1
60+ rm swoole.tar.gz
61+ cd swoole
62+ phpize
63+ ./configure --enable-openssl --enable-http2
64+ make -j$(nproc)
65+ sudo make install
66+ php --ri swoole
67+ else
68+ export CPPFLAGS="$CPPFLAGS -I$(brew --prefix pcre2)/include -L$(brew --prefix pcre2)/lib"
69+ wget https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz
70+ mkdir -p swoole
71+ tar -xf swoole.tar.gz -C swoole --strip-components=1
72+ rm swoole.tar.gz
73+ cd swoole
74+ phpize
75+ ./configure --enable-openssl --with-openssl-dir=$(brew --prefix openssl) --enable-http2
76+ make -j$(sysctl -n hw.logicalcpu)
77+ sudo make install
78+ php --ri swoole
79+ fi
11380
11481 - name : Setup Dependencies
11582 env :
11683 COMPOSER_ROOT_VERSION : 1.x-dev
117- run :
118- composer install -o
84+ run : composer install -o
11985
12086 - name : Coding Standards Check
12187 if : matrix.php-version == '8.1'
122- run : |
123- composer cs-check
88+ run : composer cs-check
12489
12590 - name : Run Test Cases
126- run : |
127- composer test
91+ run : composer test
0 commit comments