name: Build

on:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  build_cached:
    name: Build tart (cached)
    runs-on: xcode-27
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v5
      - name: Build
        run: |
          export COMPILATION_CACHE_ENABLE_CACHING=YES
          export COMPILATION_CACHE_REMOTE_SERVICE_PATH="$HOME/.cirruslabs/omni-cache.sock"
          export COMPILATION_CACHE_ENABLE_PLUGIN=YES
          export COMPILATION_CACHE_ENABLE_INTEGRATED_QUERIES=YES
          export COMPILATION_CACHE_ENABLE_DETACHED_KEY_QUERIES=YES
          export SWIFT_ENABLE_COMPILE_CACHE=YES
          export SWIFT_ENABLE_EXPLICIT_MODULES=YES
          export SWIFT_USE_INTEGRATED_DRIVER=YES
          export CLANG_ENABLE_COMPILE_CACHE=YES
          export CLANG_ENABLE_MODULES=YES
          swift build --build-system swiftbuild --product tart

  build_no_cache:
    name: Build tart (no cache)
    runs-on: xcode-27
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v5
      - name: Build
        run: swift build --build-system swiftbuild --product tart
