name: tsan

on:
  push:
    branches:
      - master
    paths:
      - '**'
      - '!.gitignore'
      - '!LICENSE'
      - '!README.md'
      - '!docs/**'
      - '!examples/**'
      - '.github/workflows/tsan.yml'
      - '.github/workflows/valgrind.yml'
  workflow_dispatch:

jobs:
  linux:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          submodules: true
      - name: build
        run: |
          cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DQJS_BUILD_WERROR=ON -DQJS_ENABLE_TSAN=ON
          cmake --build build -j`nproc`
      - name: test
        run: |
          git submodule update --init --checkout --depth 1
          ./build/run-test262 -m -c test262.conf -c test262-fast.conf -a
