name: CI

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

jobs:
  xcode:
    name: Xcode
    runs-on: macOS-latest
    strategy:
      fail-fast: false
      matrix:
        MODE: ["OSXCore", "iOSCore", "tvOSCore", "watchOSCore"]
        CFG: ["Debug", "Release"]
        include:
        - MODE: "ServiceGenerator"
          CFG: "Both"
    steps:
    - uses: actions/checkout@v2
      with:
        submodules: True
    - name: Build and Test
      run:  Tests/xcode_tests.sh ${{ matrix.MODE }} ${{ matrix.CFG }}

  swiftpm:
    name: SwiftPM
    runs-on: macOS-latest
    strategy:
      fail-fast: false
      matrix:
        MODE: ["Lib"]
        CFG: ["Debug", "Release"]
        include:
        - MODE: "ServiceGenerator"
          CFG: "Both"
    steps:
    - uses: actions/checkout@v2
    - name: Build and Test
      run:  Tests/swiftpm_tests.sh ${{ matrix.MODE }} ${{ matrix.CFG }}

  examples:
    name: Examples
    needs: xcode
    runs-on: macOS-latest
    strategy:
      fail-fast: false
      matrix:
        MODE: ["Example_CalendarSample", "Example_DriveSample", "Example_YouTubeSample", "Example_StorageSample"]
        CFG: ["Both"]
    steps:
    - uses: actions/checkout@v2
      with:
        submodules: True
    - name: Build and Test
      run:  Tests/xcode_tests.sh ${{ matrix.MODE }} ${{ matrix.CFG }}

  pods:
    name: CocoaPods Integration Tests
    needs: xcode
    runs-on: macOS-latest
    strategy:
      fail-fast: false
      matrix:
        MODE: ["ios", "osx", "tvos"]
        CFG: ["Debug", "Release"]
    steps:
    - uses: actions/checkout@v2
    - name: Test
      run:  Tests/pod_integration_tests.sh ${{ matrix.MODE }} ${{ matrix.CFG }}

Set up all the CI in github actions.
Set up all the CI in github actions.
