jemmons/BagOfTricks

View on GitHub
.github/workflows/JustTest.yml

Summary

Maintainability
Test Coverage
name: Tests Pass for Pull Request


on: [pull_request]


env:
  RESULT_PATH: Output.xcresult
  BUILD_CACHE_PATH: BuildCache


jobs:
  build_and_test:
    name: Build and Test
    runs-on: macOS-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v1

    - name: Shared Values
      id: shared
      uses: jemmons/SharedValuesAction@v1

    - name: Cache Build
      uses: actions/cache@v1
      with:
        path: ${{ steps.shared.outputs.buildCachePath }}
        key: xcodebuild-${{ runner.OS }}-swift${{ steps.shared.outputs.swiftVersion }}-${{ hashFiles('Sources/**/*.swift') }}
        restore-keys: |
          xcodebuild-${{ runner.OS }}-swift${{ steps.shared.outputs.swiftVersion }}-
          xcodebuild-${{ runner.OS }}-

    - name: Build
      run: xcodebuild build-for-testing -scheme ${{ steps.shared.outputs.project }} -enableCodeCoverage YES -derivedDataPath ${{ steps.shared.outputs.buildCachePath }}

    - name: Test
      run: xcodebuild test-without-building -scheme ${{ steps.shared.outputs.project }} -enableCodeCoverage YES -derivedDataPath ${{ steps.shared.outputs.buildCachePath }} -resultBundleVersion 3 -resultBundlePath ${{ steps.shared.outputs.resultPath }}