zhuhaow/NEKit

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: CI

on: [push, pull_request]

jobs:
  build:
    runs-on: macOS-latest
    strategy:
      matrix:
        os: [iOS, macOS]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Convert OS to Carthage OS parameter
        id: os_transform
        run: |
          printf "##[set-output name=os;]" && [[ "${{ matrix.os }}" = "iOS" ]] && echo ios || echo mac
      - name: Recovering Carthage Cache
        uses: actions/cache@v1.1.2
        id: carthage_cache
        with:
          path: Carthage
          key: ${{ matrix.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
      - name: Building Carthage Dependencies
        if: steps.carthage_cache.outputs.cache-hit != 'true'
        run: carthage bootstrap --no-use-binaries --platform ${{ steps.os_transform.outputs.os }}
      - name: Recovering Bundler Cache
        uses: actions/cache@v1.1.2
        id: bundler_cache
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - name: Installing Bundler Dependencies
        if: steps.bundler_cache.outputs.cache-hit != 'true'
        run: bundle install
      - name: Build and Test
        run: bundle exec fastlane scan --scheme NEKit-${{ matrix.os }}