Skip to content

Commit e257fba

Browse files
committed
CI: added test with QuickJS-NG in check-pr job.
1 parent d4f12ad commit e257fba

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/check-pr.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ jobs:
4848
cd quickjs
4949
CFLAGS=$CC_OPT LDFLAGS=$LD_OPT $MAKE_UTILITY -j$(nproc) libquickjs.a
5050
51+
- name: Check out and build quickjs-ng
52+
run: |
53+
git clone https://github.com/quickjs-ng/quickjs quickjs-ng
54+
cd quickjs-ng
55+
git checkout v0.8.0
56+
CFLAGS="$CC_OPT -fPIC" LDFLAGS=$LD_OPT cmake -B build
57+
cmake --build build --target qjs -j $(nproc)
58+
5159
- name: Configure and make njs
5260
run: |
5361
./configure \
@@ -88,6 +96,20 @@ jobs:
8896
$MAKE_UTILITY test
8997
$MAKE_UTILITY clean
9098
99+
- name: Configure and make njs with quickjs-ng
100+
run: |
101+
./configure \
102+
--with-quickjs \
103+
--cc-opt="$CC_OPT -Iquickjs-ng" \
104+
--ld-opt="$LD_OPT -Lquickjs-ng/build" \
105+
|| cat build/autoconf.err
106+
$MAKE_UTILITY -j$(nproc)
107+
108+
- name: Test njs with quickjs-ng
109+
run: |
110+
$MAKE_UTILITY test
111+
$MAKE_UTILITY clean
112+
91113
- name: Configure and build nginx and njs modules
92114
run: |
93115
cd nginx-source
@@ -168,3 +190,62 @@ jobs:
168190
TEST_NGINX_VERBOSE: 1
169191
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:fast_unwind_on_malloc=0"
170192
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"
193+
194+
- name: Configure and build nginx and njs modules with quickjs-ng, asan, static modules
195+
run: |
196+
cd nginx-source
197+
$NGINX_CONFIGURE_CMD --with-cc-opt="$CC_OPT -I${{ github.workspace }}/quickjs-ng -fsanitize=address -DNJS_DEBUG_MEMORY -DNGX_DEBUG_PALLOC -DNGX_DEBUG_MALLOC" --with-ld-opt="$LD_OPT -L${{ github.workspace }}/quickjs-ng/build -fsanitize=address" --add-module=../nginx || cat objs/autoconf.err
198+
$MAKE_UTILITY -j$(nproc)
199+
200+
- name: Test njs modules, quickjs-ng, static modules
201+
run: |
202+
ulimit -c unlimited
203+
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
204+
env:
205+
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
206+
TEST_NGINX_VERBOSE: 1
207+
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0"
208+
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"
209+
210+
- name: Test njs modules (js_engine qjs), quickjs-ng, static modules
211+
run: |
212+
ulimit -c unlimited
213+
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
214+
env:
215+
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
216+
TEST_NGINX_GLOBALS_HTTP: "js_engine qjs;"
217+
TEST_NGINX_GLOBALS_STREAM: "js_engine qjs;"
218+
TEST_NGINX_VERBOSE: 1
219+
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0"
220+
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"
221+
222+
- name: Configure and build nginx and njs modules with quickjs-ng, asan, dynamic modules
223+
run: |
224+
cd nginx-source
225+
$NGINX_CONFIGURE_CMD --with-debug --with-cc-opt="$CC_OPT -I${{ github.workspace }}/quickjs-ng -fsanitize=address -DNJS_DEBUG_MEMORY -DNGX_DEBUG_PALLOC -DNGX_DEBUG_MALLOC" --with-ld-opt="$LD_OPT -L${{ github.workspace }}/quickjs-ng/build -fsanitize=address" --add-dynamic-module=../nginx || cat objs/autoconf.err
226+
$MAKE_UTILITY -j$(nproc) modules
227+
$MAKE_UTILITY -j$(nproc)
228+
229+
- name: Test njs modules, quickjs-ng, dynamic modules
230+
run: |
231+
ulimit -c unlimited
232+
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
233+
env:
234+
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
235+
TEST_NGINX_GLOBALS: "load_module ${{ github.workspace }}/nginx-source/objs/ngx_stream_js_module.so; load_module ${{ github.workspace }}/nginx-source/objs/ngx_http_js_module.so;"
236+
TEST_NGINX_VERBOSE: 1
237+
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:fast_unwind_on_malloc=0"
238+
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"
239+
240+
- name: Test njs modules (js_engine qjs), quickjs-ng, dynamic modules
241+
run: |
242+
ulimit -c unlimited
243+
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
244+
env:
245+
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
246+
TEST_NGINX_GLOBALS: "load_module ${{ github.workspace }}/nginx-source/objs/ngx_stream_js_module.so; load_module ${{ github.workspace }}/nginx-source/objs/ngx_http_js_module.so;"
247+
TEST_NGINX_GLOBALS_HTTP: "js_engine qjs;"
248+
TEST_NGINX_GLOBALS_STREAM: "js_engine qjs;"
249+
TEST_NGINX_VERBOSE: 1
250+
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:fast_unwind_on_malloc=0"
251+
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"

0 commit comments

Comments
 (0)