]> git.kaiwu.me - njs.git/commitdiff
CI: split test262 runs into independent PR checks
authorDmitry Volyntsev <xeioex@nginx.com>
Sat, 24 Oct 2026 05:51:50 +0000 (22:51 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 19 Nov 2026 06:44:10 +0000 (22:44 -0800)
Previously, normal, UBSan and ASan runs shared one test262 job, so the
PR checks page did not distinguish their results.  A failure in an
earlier run also prevented the remaining configurations from running.

Use a named matrix with fail-fast disabled, following the CLI workflow.
Each configuration builds from a fresh checkout and retains its
configure flags, sanitizer options, suite revision, failure baseline
and test timeouts.

.github/workflows/test262.yml

index aa9961b1b08de938c9c33235c785032b92ca1178..5afc41fccb9095f495501295d3368d6bd69069ec 100644 (file)
@@ -13,8 +13,19 @@ concurrency:
 
 jobs:
   test262:
+    name: test262 ${{ matrix.name }}
     runs-on: ubuntu-24.04
     timeout-minutes: 20
+    strategy:
+      fail-fast: false
+      matrix:
+        include:
+          - name: normal
+            mode: normal
+          - name: UBSan
+            mode: ubsan
+          - name: ASan
+            mode: asan
 
     steps:
       - name: Checkout njs
@@ -36,46 +47,35 @@ jobs:
 
       - name: Build test262
         run: |
-          ./configure
+          case "${{ matrix.mode }}" in
+              normal)
+                  ./configure
+                  ;;
+              ubsan)
+                  CC=clang-18 ./configure \
+                      --cc-opt='-O2 -fsanitize=undefined' \
+                      --ld-opt='-fsanitize=undefined'
+                  ;;
+              asan)
+                  CC=clang-18 ./configure \
+                      --address-sanitizer=YES --cc-opt=-O2
+                  ;;
+          esac
           make -j$(nproc) njs_test262
 
       - name: Run test262
         run: |
+          case "${{ matrix.mode }}" in
+              ubsan)
+                  export UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
+                  ;;
+              asan)
+                  export ASAN_OPTIONS=detect_leaks=0
+                  ;;
+          esac
           TZ=UTC timeout 15m build/njs_test262 \
               --config test/njs_test262.conf \
               --suite "$GITHUB_WORKSPACE/test262" \
               --failures "$GITHUB_WORKSPACE/test/njs_test262.failures" \
               --isolation=process \
               --timeout=5
-
-      - name: Build test262 with UBSan
-        run: |
-          make clean
-          CC=clang-18 ./configure --cc-opt='-O2 -fsanitize=undefined' \
-              --ld-opt='-fsanitize=undefined'
-          make -j$(nproc) njs_test262
-
-      - name: Run test262 with UBSan
-        run: |
-          TZ=UTC UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 \
-              timeout 15m build/njs_test262 \
-              --config test/njs_test262.conf \
-              --suite "$GITHUB_WORKSPACE/test262" \
-              --failures "$GITHUB_WORKSPACE/test/njs_test262.failures" \
-              --isolation=process \
-              --timeout=5
-
-      - name: Build test262 with ASan
-        run: |
-          make clean
-          CC=clang-18 ./configure --address-sanitizer=YES --cc-opt=-O2
-          make -j$(nproc) njs_test262
-
-      - name: Run test262 with ASan
-        run: |
-          TZ=UTC ASAN_OPTIONS=detect_leaks=0 timeout 15m build/njs_test262 \
-              --config test/njs_test262.conf \
-              --suite "$GITHUB_WORKSPACE/test262" \
-              --failures "$GITHUB_WORKSPACE/test/njs_test262.failures" \
-              --isolation=process \
-              --timeout=5