name: SwiftLint Analyze

on:
  push:
    branches: [main]
    paths: 
      - '.github/workflows/swiftlint_analyze.yml'
      - 'Yams.xcodeproj/**'
      - 'Sources/**/*.[ch]'
      - 'Sources/**/*.swift'
      - 'Tests/**/*.swift'
      - '!Tests/LinuxMain.swift'
  pull_request:
    paths:
      - '.github/workflows/swiftlint_analyze.yml'
      - 'Yams.xcodeproj/**'
      - 'Sources/**/*.[ch]'
      - 'Sources/**/*.swift'
      - 'Tests/**/*.swift'
      - '!Tests/LinuxMain.swift'

jobs:
  Analyze:
    runs-on: macos-latest
    env:
      DEVELOPER_DIR: /Applications/Xcode_12.2.app
    steps:
      - uses: actions/checkout@v2
      - name: Generate xcodebuild.log
        run: xcodebuild -scheme Yams -project Yams.xcodeproj clean build-for-testing > xcodebuild.log
        shell: bash
      - name: Install SwiftLint
        run: brew install swiftlint
      - name: Run SwiftLint Analyze
        run: swiftlint analyze --strict --compiler-log-path xcodebuild.log --reporter github-actions-logging

name: SwiftLint Analyze

on:
  push:
    branches: [main]
    paths: 
      - '.github/workflows/swiftlint_analyze.yml'
      - 'Yams.xcodeproj/**'
      - 'Sources/**/*.[ch]'
      - 'Sources/**/*.swift'
      - 'Tests/**/*.swift'
      - '!Tests/LinuxMain.swift'
  pull_request:
    paths:
      - '.github/workflows/swiftlint_analyze.yml'
      - 'Yams.xcodeproj/**'
      - 'Sources/**/*.[ch]'
      - 'Sources/**/*.swift'
      - 'Tests/**/*.swift'
      - '!Tests/LinuxMain.swift'

jobs:
  Analyze:
    runs-on: macos-latest
    env:
      DEVELOPER_DIR: /Applications/Xcode_12.2.app
    steps:
      - uses: actions/checkout@v2
      - name: Generate xcodebuild.log
        run: xcodebuild -scheme Yams -project Yams.xcodeproj clean build-for-testing > xcodebuild.log
        shell: bash
      - name: Install SwiftLint
        run: brew install swiftlint || brew upgrade swiftlint
      - name: Run SwiftLint Analyze
        run: swiftlint analyze --strict --compiler-log-path xcodebuild.log --reporter github-actions-logging

Fix SwiftLint analyze CI job
Fix SwiftLint analyze CI job

Seems like some macOS GitHub Actions agents already have SwiftLint
installed.
