name: "Swift Common"
description: "Common Swift Checks"

runs:
  using: "composite"

  steps:
    - name: Setup Swift
      uses: swift-actions/setup-swift@cdbe0f7f4c77929b6580e71983e8606e55ffe7e4 # v1.26.2
      with:
        swift-version: ${{ env.swift-version }}
    - name: Setup Xcode
      uses: maxim-lobanov/setup-xcode@7f352e61cbe8130c957c3bc898c4fb025784ea1e
      with:
        xcode-version: '26.0.1'
    - name: List simulators
      shell: bash
      run: |
        xcrun simctl list
        xcodebuild -showsdks
    - name: Install Homebrew
      uses: Homebrew/actions/setup-homebrew@d54a6744d5fcdff54b45a9659f3e17f769389952
    - name: Install Homebrew dependencies
      shell: bash
      run: |
        brew install swiftlint swift-format xcodegen
    - uses: ./.github/shared/setup-rust
    - name: Lint
      working-directory: ./app-ios
      shell: bash
      run: ./lint.sh lint:check
    - name: Format
      working-directory: ./app-ios
      shell: bash
      run: ./lint.sh style:check
    - name: Xcodegen sdk
      working-directory: tuta-sdk/ios
      shell: bash
      run: xcodegen