]> git.kaiwu.me - njs.git/commitdiff
CI: added test with QuickJS-NG in check-pr job.
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 23 Jan 2025 02:03:55 +0000 (18:03 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Fri, 24 Jan 2025 23:12:19 +0000 (15:12 -0800)
.github/workflows/check-pr.yml

index 0c7d7f3ee57cacebacd0c8f78cd5ac39acbe4172..7cff79372d288f8d514763e21455662d066b5c97 100644 (file)
@@ -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 \
@@ -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
@@ -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"