name: CI

on: [push, pull_request]

jobs:
  macOS:
    name: Test on macOS
    runs-on: macOS-latest
    steps:
    - uses: actions/checkout@v1
    - name: Show environments
      run: |
        swift --version
        xcodebuild -version
    - name: Lint Swift
      run: |
        brew install swiftlint
        swiftlint
    - name: Build & test SwiftPM
      run: |
        swift build
        swift test 2>&1 | xcpretty -c
    - name: Lint Cocoapod
      run: pod lib lint --quick

  xcode:
    name: Test with Xcode
    runs-on: macOS-latest
    strategy:
        matrix:
          name: [macOS, iOS, tvOS]
          include:
            - name: macOS
              scheme: Gzip macOS
              sdk: macosx
              destination: 'platform=macOS'
            - name: iOS
              scheme: Gzip iOS
              sdk: iphonesimulator
              destination: 'platform=iOS Simulator,name=iPhone 11'
            - name: tvOS
              scheme: Gzip tvOS
              sdk: appletvsimulator
              destination: 'platform=tvOS Simulator,name=Apple TV 4K'
    steps:
    - uses: actions/checkout@v1
    - name: Test
      run: |
          set -o pipefail
          xcodebuild clean test -scheme "${{matrix.scheme}}" -sdk "${{matrix.sdk}}" -destination "${{matrix.destination}}" | xcpretty -c

name: CI

on: [push, pull_request]

jobs:
  macOS:
    name: Test on macOS
    runs-on: macOS-latest
    steps:
    - uses: actions/checkout@v1
    - name: Show environments
      run: |
        swift --version
        xcodebuild -version
    - name: Lint Swift
      run: |
        brew install swiftlint
        swiftlint
    - name: Build & test SwiftPM
      run: |
        swift build
        swift test 2>&1 | xcpretty -c
    - name: Lint Cocoapod
      run: pod lib lint --quick
  linux:
    runs-on: ubuntu-latest
    container: swift:5.4-focal
    steps:
    - uses: actions/checkout@v2
    - name: Unit Test
      run: swift test --enable-test-discovery

  xcode:
    name: Test with Xcode
    runs-on: macOS-latest
    strategy:
        matrix:
          name: [macOS, iOS, tvOS]
          include:
            - name: macOS
              scheme: Gzip macOS
              sdk: macosx
              destination: 'platform=macOS'
            - name: iOS
              scheme: Gzip iOS
              sdk: iphonesimulator
              destination: 'platform=iOS Simulator,name=iPhone 11'
            - name: tvOS
              scheme: Gzip tvOS
              sdk: appletvsimulator
              destination: 'platform=tvOS Simulator,name=Apple TV 4K'
    steps:
    - uses: actions/checkout@v1
    - name: Test
      run: |
          set -o pipefail
          xcodebuild clean test -scheme "${{matrix.scheme}}" -sdk "${{matrix.sdk}}" -destination "${{matrix.destination}}" | xcpretty -c

Add CI test on ubuntu
Add CI test on ubuntu
