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@v4
        with:
          submodules: true
      - name: build
        run: |
          cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCONFIG_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