File tree Expand file tree Collapse file tree 6 files changed +103
-0
lines changed Expand file tree Collapse file tree 6 files changed +103
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Async IO With IOUring
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ test-linux :
7
+ runs-on : ubuntu-latest
8
+ strategy :
9
+ fail-fast : false
10
+ matrix :
11
+ php : ['8.1', '8.2', '8.3']
12
+ name : ${{ matrix.php }}
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+ - name : Setup PHP
16
+ uses : shivammathur/setup-php@v2
17
+ with :
18
+ php-version : " ${{ matrix.php }}"
19
+ coverage : none
20
+ - name : Show machine information
21
+ run : |
22
+ date
23
+ env
24
+ uname -a
25
+ ulimit -a
26
+ php -v
27
+ php --ini
28
+ ls -al
29
+ pwd
30
+ echo "`git log -20 --pretty --oneline`"
31
+ echo "`git log -10 --stat --pretty --oneline`"
32
+ - name : Run Swoole test
33
+ run : |
34
+ export SWOOLE_BRANCH=${GITHUB_REF##*/}
35
+ export SWOOLE_USE_IOURING=1
36
+ export SWOOLE_BUILD_DIR=$(realpath .)
37
+ export PHP_VERSION=${{ matrix.php }}
38
+ ${SWOOLE_BUILD_DIR}/scripts/route.sh
39
+
Original file line number Diff line number Diff line change
1
+ #! /bin/sh -e
2
+ __CURRENT__=$( pwd)
3
+ __DIR__=$( cd " $( dirname " $0 " ) " ; pwd)
4
+
5
+ if [ ! -f " /.dockerenv" ]; then
6
+ echo " " && echo " ❌ This script is just for Docker!"
7
+ exit
8
+ fi
9
+
10
+ sh library.sh
11
+
12
+ cd " ${__DIR__} " && cd ..
13
+ ./scripts/clear.sh && phpize && ./configure --enable-iouring
14
+
15
+ make -j$( cat /proc/cpuinfo | grep processor | wc -l)
16
+ make install
17
+ docker-php-ext-enable swoole
18
+ php -v
19
+ php -m
20
+ php --ri curl
21
+ php --ri swoole
22
+
Original file line number Diff line number Diff line change
1
+ #! /bin/sh -e
2
+ __CURRENT__=$( pwd)
3
+ __DIR__=$( cd " $( dirname " $0 " ) " ; pwd)
4
+ export SWOOLE_USE_IOURING=1
5
+
6
+ # enter the dir
7
+ cd " ${__DIR__} "
8
+
9
+ # show system info
10
+ date && echo " "
11
+ uname -a && echo " "
12
+
13
+ # show php info
14
+ php -v && echo " "
15
+
16
+ # compile in docker
17
+ echo " " && echo " 📦 Compile ext-swoole[iouring] in docker..." && echo " "
18
+ ./docker-compile-with-iouring.sh
19
+
20
+ # run unit tests
21
+ echo " " && echo " 📋 Run php tests[iouring] in docker..." && echo " "
22
+ ./run-tests.sh
23
+
Original file line number Diff line number Diff line change @@ -12,3 +12,8 @@ echo DISABLE_INTERRUPT=on > ./instantclient/network/admin/sqlnet.ora
12
12
mv ./instantclient /usr/local/
13
13
echo ' /usr/local/instantclient' > /etc/ld.so.conf.d/oracle-instantclient.conf
14
14
ldconfig
15
+
16
+ wget https://github.com/axboe/liburing/archive/refs/tags/liburing-2.6.tar.gz
17
+ tar zxf liburing-2.6.tar.gz
18
+ cd liburing-liburing-2.6 && ./configure && make -j$( cat /proc/cpuinfo | grep processor | wc -l) && make install
19
+
Original file line number Diff line number Diff line change @@ -92,6 +92,16 @@ run_thread_tests_in_docker(){
92
92
fi
93
93
}
94
94
95
+ run_iouring_tests_in_docker (){
96
+ docker exec swoole touch /.cienv && \
97
+ docker exec swoole /swoole-src/scripts/docker-iouring-route.sh
98
+ code=$?
99
+ if [ $code -ne 0 ]; then
100
+ echo " \n❌ Run iouring tests failed! ExitCode: $code "
101
+ exit 1
102
+ fi
103
+ }
104
+
95
105
remove_tests_resources (){
96
106
remove_docker_containers
97
107
remove_data_files
@@ -109,6 +119,8 @@ echo "\n⏳ Run tests in docker...\n"
109
119
110
120
if [ " $SWOOLE_THREAD " = 1 ]; then
111
121
run_thread_tests_in_docker
122
+ elif [ " $SWOOLE_USE_IOURING " = 1 ]; then
123
+ run_iouring_tests_in_docker
112
124
else
113
125
run_tests_in_docker
114
126
fi
Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ if [ "${SWOOLE_BRANCH}" = "valgrind" ]; then
61
61
options=" ${options} -m"
62
62
elif [ " $SWOOLE_THREAD " = 1 ]; then
63
63
dir=" swoole_thread"
64
+ elif [ " $SWOOLE_USE_IOURING " = 1 ]; then
65
+ dir=" swoole_runtime/file_hook"
64
66
else
65
67
dir=" swoole_*"
66
68
fi
You can’t perform that action at this time.
0 commit comments