name: Debug CI

on: [workflow_dispatch]

jobs:
  debug-msvc:
    runs-on: windows-2025
    timeout-minutes: 121
    env:
      VFLAGS: -cc msvc
    steps:
      - uses: actions/checkout@v4
      - name: Build
        run: |
          echo %VFLAGS%
          echo $VFLAGS
          .\make.bat -msvc
          .\v.exe -cflags /WX self
      - name: Install dependencies
        run: |
          .\v.exe setup-freetype
          .\.github\workflows\windows-install-sqlite.bat
      - name: v doctor
        run: ./v doctor
      - name: Verify `v test` works
        run: |
          ./v cmd/tools/test_if_v_test_system_works.v
          ./cmd/tools/test_if_v_test_system_works
      - name: All code is formatted
        run: ./v -silent test-cleancode
      - name: Self tests
        run: ./v -silent test-self
      - name: Test v->js
        run: ./v -o hi.js examples/js_hello_world.v && node hi.js
      - name: Test v binaries
        run: ./v build-vbinaries
      - name: Build examples
        run: ./v -silent build-examples
      - name: v2 self compilation
        run: .\v.exe -o v2.exe cmd/v && .\v2.exe -o v3.exe cmd/v
