diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index e51d8ba8a..2c97342ed 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -42,72 +42,39 @@ jobs: cd quickjs && curl -OL http://pp.nginx.com/pluknet/quickjs.patch && git apply quickjs.patch CFLAGS=$CC_OPT LDFLAGS=$LD_OPT $MAKE_UTILITY -j$(nproc) libquickjs.a - - name: Configure and make njs - run: | - ./configure \ - --cc-opt="$CC_OPT" \ - --ld-opt="$LD_OPT" \ - || cat build/autoconf.err - $MAKE_UTILITY -j$(nproc) - - - name: Test njs - run: | - $MAKE_UTILITY test - $MAKE_UTILITY clean - - - name: Configure and make njs with quickjs - run: | - ./configure \ - --with-quickjs \ - --cc-opt="$CC_OPT -Iquickjs" \ - --ld-opt="$LD_OPT -Lquickjs" \ - || cat build/autoconf.err - $MAKE_UTILITY -j$(nproc) - - - name: Test njs with quickjs - run: | - $MAKE_UTILITY test - $MAKE_UTILITY clean - - - name: Configure and build nginx and njs modules - run: | - cd nginx-source - $NGINX_CONFIGURE_CMD --with-cc-opt="$CC_OPT" --with-ld-opt="$LD_OPT" --add-dynamic-module=../nginx || cat objs/autoconf.err - $MAKE_UTILITY -j$(nproc) modules - $MAKE_UTILITY -j$(nproc) - - - name: Test njs 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_http_js_module.so; load_module ${{ github.workspace }}/nginx-source/objs/ngx_stream_js_module.so;" - TEST_NGINX_VERBOSE: 1 - - name: Configure and build nginx and njs modules with quickjs run: | cd nginx-source - $NGINX_CONFIGURE_CMD --with-cc-opt="$CC_OPT -I${{ github.workspace }}/quickjs" --with-ld-opt="$LD_OPT -L${{ github.workspace }}/quickjs" --add-dynamic-module=../nginx || cat objs/autoconf.err + $NGINX_CONFIGURE_CMD --with-debug --with-cc-opt="$CC_OPT -I${{ github.workspace }}/quickjs -fsanitize=address" --with-ld-opt="$LD_OPT -L${{ github.workspace }}/quickjs -fsanitize=address" --add-dynamic-module=../nginx || cat objs/autoconf.err $MAKE_UTILITY -j$(nproc) modules $MAKE_UTILITY -j$(nproc) - - name: Test njs 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_http_js_module.so; load_module ${{ github.workspace }}/nginx-source/objs/ngx_stream_js_module.so;" - TEST_NGINX_VERBOSE: 1 - - name: Test njs modules (js_engine qjs) run: | ulimit -c unlimited - prove -v -Inginx-tests/lib --state=save nginx/t . || prove -v -Inginx-tests/lib --state=failed + for test_file in nginx/t/*.t; do + rm -fr /tmp/nginx-test-* || true + prove -v -Inginx-tests/lib nginx/t/$(basename $test_file) || mv /tmp/nginx-test-* /tmp/nginx-tests-$(basename $test_file) + done env: TEST_NGINX_BINARY: "${{ github.workspace }}/nginx-source/objs/nginx" TEST_NGINX_GLOBALS: "load_module ${{ github.workspace }}/nginx-source/objs/ngx_http_js_module.so; load_module ${{ github.workspace }}/nginx-source/objs/ngx_stream_js_module.so;" TEST_NGINX_GLOBALS_HTTP: "js_engine qjs;" TEST_NGINX_GLOBALS_STREAM: "js_engine qjs;" TEST_NGINX_VERBOSE: 1 + TEST_NGINX_LEAVE: 1 + ASAN_OPTIONS: "detect_odr_violation=0:report_globals=0:detect_leaks=0" + + - name: Preserve debug logs + if: always() + run: | + sudo mkdir -p /tmp/nginx-debug-logs + sudo cp -R /tmp/nginx-tests-* /tmp/nginx-debug-logs/ + sudo chmod -R 777 /tmp/nginx-debug-logs + + - name: Upload debug logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: nginx-debug-logs + path: /tmp/nginx-debug-logs