# SPDX-FileCopyrightText: Nextcloud GmbH
# SPDX-FileCopyrightText: 2025 Iva Horn
# SPDX-License-Identifier: LGPL-3.0-or-later

name: NextcloudFileProviderKit

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  Lint:
    runs-on: macos-latest

    defaults:
      run:
        working-directory: shell_integration/MacOSX/NextcloudFileProviderKit

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

      - name: SwiftFormat
        run: swiftformat --lint . --reporter github-actions-log

  Tests:
    runs-on: macos-latest

    defaults:
      run:
        working-directory: shell_integration/MacOSX/NextcloudFileProviderKit

    steps:
    - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

    - uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
      with:
        xcode-version: latest-stable

    - name: Run Tests
      run: xcodebuild clean build test -scheme NextcloudFileProviderKit -destination "platform=macOS,name=My Mac"
