Kinvey/swift-sdk

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: CI

on:
  pull_request:
    branches: [master]
  schedule:
    - cron: "0 7 * * *"
  workflow_dispatch: ~

jobs:
  swift-build:
    runs-on: macos-11
    steps:
      - run: sudo xcode-select -switch /Applications/Xcode_13.2.1.app
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        id: spm-cache-key
        with:
          path: README.md
          key: key-${{ runner.os }}-spm-13.2.1-${{ hashFiles('**/Package.swift') }}

      - if: steps.spm-cache-key.outputs.cache-hit != 'true'
        run: swift build

  build-deps:
    runs-on: macos-11
    steps:
      - run: sudo xcode-select -switch /Applications/Xcode_13.2.1.app
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        id: carthage-cache-key
        with:
          path: README.md
          key: key-${{ runner.os }}-carthage-13.2.1-${{ hashFiles('**/Cartfile.resolved') }}

      - if: steps.carthage-cache-key.outputs.cache-hit != 'true'
        uses: actions/cache@v2
        id: carthage-cache
        with:
          path: Carthage
          key: ${{ runner.os }}-carthage-13.2.1-${{ hashFiles('**/Cartfile.resolved') }}

      - if: steps.carthage-cache-key.outputs.cache-hit != 'true'
        run: make build-deps

  test-ios:
    runs-on: macos-11
    steps:
      - run: sudo xcode-select -switch /Applications/Xcode_12.4.app
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        id: carthage-cache
        with:
          path: Carthage
          key: ${{ runner.os }}-carthage-12.4-${{ hashFiles('**/Cartfile.resolved') }}

      - if: steps.carthage-cache.outputs.cache-hit != 'true'
        run: make build-ios
      - run: make test-ios DESTINATION_OS=14.4 DESTINATION_NAME='iPhone 12 mini'

  test-macos:
    needs: build-deps
    runs-on: macos-11
    steps:
      - run: sudo xcode-select -switch /Applications/Xcode_13.2.1.app
      - uses: actions/checkout@v2
      - uses: actions/cache@v2
        id: carthage-cache
        with:
          path: Carthage
          key: ${{ runner.os }}-carthage-13.2.1-${{ hashFiles('**/Cartfile.resolved') }}

      - if: steps.carthage-cache.outputs.cache-hit == 'true'
        run: make test-macos