|
| 1 | +name: test262 |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 12 | + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + test262: |
| 16 | + runs-on: ubuntu-24.04 |
| 17 | + timeout-minutes: 20 |
| 18 | + |
| 19 | + steps: |
| 20 | + - name: Checkout njs |
| 21 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 22 | + |
| 23 | + - name: Install build dependencies |
| 24 | + run: | |
| 25 | + sudo apt-get update |
| 26 | + sudo apt-get install clang-18 libssl-dev zlib1g-dev libpcre2-dev \ |
| 27 | + libxml2-dev |
| 28 | +
|
| 29 | + - name: Checkout test262 |
| 30 | + run: | |
| 31 | + test262_sha=$(cat test/njs_test262.version) |
| 32 | + git clone --depth=1 https://github.com/tc39/test262 test262 |
| 33 | + git -C test262 fetch --depth=1 origin "$test262_sha" |
| 34 | + git -C test262 checkout --detach "$test262_sha" |
| 35 | + test "$(git -C test262 rev-parse HEAD)" = "$test262_sha" |
| 36 | +
|
| 37 | + - name: Build test262 |
| 38 | + run: | |
| 39 | + ./configure |
| 40 | + make -j$(nproc) njs_test262 |
| 41 | +
|
| 42 | + - name: Run test262 |
| 43 | + run: | |
| 44 | + TZ=UTC timeout 15m build/njs_test262 \ |
| 45 | + --config test/njs_test262.conf \ |
| 46 | + --suite "$GITHUB_WORKSPACE/test262" \ |
| 47 | + --failures "$GITHUB_WORKSPACE/test/njs_test262.failures" \ |
| 48 | + --isolation=process \ |
| 49 | + --timeout=5 |
| 50 | +
|
| 51 | + - name: Build test262 with UBSan |
| 52 | + run: | |
| 53 | + make clean |
| 54 | + CC=clang-18 ./configure --cc-opt='-O2 -fsanitize=undefined' \ |
| 55 | + --ld-opt='-fsanitize=undefined' |
| 56 | + make -j$(nproc) njs_test262 |
| 57 | +
|
| 58 | + - name: Run test262 with UBSan |
| 59 | + run: | |
| 60 | + TZ=UTC UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1 \ |
| 61 | + timeout 15m build/njs_test262 \ |
| 62 | + --config test/njs_test262.conf \ |
| 63 | + --suite "$GITHUB_WORKSPACE/test262" \ |
| 64 | + --failures "$GITHUB_WORKSPACE/test/njs_test262.failures" \ |
| 65 | + --isolation=process \ |
| 66 | + --timeout=5 |
| 67 | +
|
| 68 | + - name: Build test262 with ASan |
| 69 | + run: | |
| 70 | + make clean |
| 71 | + CC=clang-18 ./configure --address-sanitizer=YES --cc-opt=-O2 |
| 72 | + make -j$(nproc) njs_test262 |
| 73 | +
|
| 74 | + - name: Run test262 with ASan |
| 75 | + run: | |
| 76 | + TZ=UTC ASAN_OPTIONS=detect_leaks=0 timeout 15m build/njs_test262 \ |
| 77 | + --config test/njs_test262.conf \ |
| 78 | + --suite "$GITHUB_WORKSPACE/test262" \ |
| 79 | + --failures "$GITHUB_WORKSPACE/test/njs_test262.failures" \ |
| 80 | + --isolation=process \ |
| 81 | + --timeout=5 |
0 commit comments