Skip to content

Commit

Permalink
CI: added test with QuickJS-NG in check-pr job.
Browse files Browse the repository at this point in the history
  • Loading branch information
xeioex committed Jan 24, 2025
1 parent 51b4dba commit 36cf464
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
cd quickjs
CFLAGS=$CC_OPT LDFLAGS=$LD_OPT $MAKE_UTILITY -j$(nproc) libquickjs.a
- name: Check out and build quickjs-ng
run: |
git clone https://github.com/quickjs-ng/quickjs quickjs-ng
cd quickjs-ng
git checkout v0.8.0
CFLAGS="$CC_OPT -fPIC" LDFLAGS=$LD_OPT cmake -B build
cmake --build build --target qjs -j $(nproc)
- name: Configure and make njs
run: |
./configure \
Expand Down Expand Up @@ -88,6 +96,20 @@ jobs:
$MAKE_UTILITY test
$MAKE_UTILITY clean
- name: Configure and make njs with quickjs-ng
run: |
./configure \
--with-quickjs \
--cc-opt="$CC_OPT -Iquickjs-ng" \
--ld-opt="$LD_OPT -Lquickjs-ng/build" \
|| cat build/autoconf.err
$MAKE_UTILITY -j$(nproc)
- name: Test njs with quickjs-ng
run: |
$MAKE_UTILITY test
$MAKE_UTILITY clean
- name: Configure and build nginx and njs modules
run: |
cd nginx-source
Expand Down Expand Up @@ -168,3 +190,62 @@ jobs:
TEST_NGINX_VERBOSE: 1
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:fast_unwind_on_malloc=0"
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"

- name: Configure and build nginx and njs modules with quickjs-ng, asan, static modules
run: |
cd nginx-source
$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
$MAKE_UTILITY -j$(nproc)
- name: Test njs modules, quickjs-ng, static modules
run: |
ulimit -c unlimited
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
TEST_NGINX_VERBOSE: 1
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0"
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"

- name: Test njs modules (js_engine qjs), quickjs-ng, static modules
run: |
ulimit -c unlimited
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
TEST_NGINX_GLOBALS_HTTP: "js_engine qjs;"
TEST_NGINX_GLOBALS_STREAM: "js_engine qjs;"
TEST_NGINX_VERBOSE: 1
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0"
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"

- name: Configure and build nginx and njs modules with quickjs-ng, asan, dynamic modules
run: |
cd nginx-source
$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
$MAKE_UTILITY -j$(nproc) modules
$MAKE_UTILITY -j$(nproc)
- name: Test njs modules, quickjs-ng, dynamic modules
run: |
ulimit -c unlimited
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
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;"
TEST_NGINX_VERBOSE: 1
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:fast_unwind_on_malloc=0"
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"

- name: Test njs modules (js_engine qjs), quickjs-ng, dynamic modules
run: |
ulimit -c unlimited
prove -v -j$(nproc) -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed
env:
TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx"
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;"
TEST_NGINX_GLOBALS_HTTP: "js_engine qjs;"
TEST_NGINX_GLOBALS_STREAM: "js_engine qjs;"
TEST_NGINX_VERBOSE: 1
ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:fast_unwind_on_malloc=0"
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan_suppressions.txt"

0 comments on commit 36cf464

Please sign in to comment.