name: CI

on:
  push:
    branches:
      - master
    tags:
      - "*"
  pull_request:

jobs:
  cocoapods:
    name: CocoaPods Lint & Danger
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - run: bundle install
      - run: bundle exec danger
        env:
          DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - run: rake podspec:lint

  xcode:
    name: Xcode ${{ matrix.xcode }} (${{ matrix.platform }})
    runs-on: macos-latest
    strategy:
      matrix:
        xcode: [11.7, 12]
        platform: ["macos", "ios", "tvos"]
      fail-fast: false
    env:
      DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - run: rake test:${{ matrix.platform }}
      - if: ${{ matrix.platform == 'macos' }}
        run: rake test:${{ matrix.platform }}_static

  swiftpm_darwin:
    name: SwiftPM, Darwin, Xcode ${{ matrix.xcode }}
    runs-on: macos-latest
    strategy:
      matrix:
        xcode: [11.7, 12]
      fail-fast: false
    env:
      DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
    steps:
      - uses: actions/checkout@v2
      - run: rake test:swiftpm

name: CI

on:
  push:
    branches:
      - master
    tags:
      - "*"
  pull_request:

jobs:
  cocoapods:
    name: CocoaPods Lint & Danger
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - run: bundle install
      - run: bundle exec danger
        env:
          DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - run: rake podspec:lint

  xcode:
    name: Xcode ${{ matrix.xcode }} (${{ matrix.platform }})
    runs-on: macos-latest
    strategy:
      matrix:
        xcode: [11.7, 12]
        platform: ["macos", "ios", "tvos"]
      fail-fast: false
    env:
      DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - run: rake test:${{ matrix.platform }}
      - if: ${{ matrix.platform == 'macos' }}
        run: rake test:${{ matrix.platform }}_static

  swiftpm_darwin:
    name: SwiftPM, Darwin, Xcode ${{ matrix.xcode }}
    runs-on: macos-latest
    strategy:
      matrix:
        xcode: [11.7, 12]
      fail-fast: false
    env:
      DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
    steps:
      - uses: actions/checkout@v2
      - run: rake test:swiftpm

Fix running Danger on PRs from forked repos
[CI] Fix running Danger on PRs from forked repos
