Add in test cov report instructions as well as workflow output #68
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pr_ci | |
on: | |
pull_request: | |
branches: | |
- main | |
types: [opened, reopened, synchronize] | |
jobs: | |
test: | |
runs-on: macos-latest | |
name: Run Unit Tests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Xcode | |
run: sudo xcode-select -switch /Applications/Xcode.app | |
- name: Cache DerivedData | |
uses: actions/cache@v3 | |
with: | |
path: ~/Library/Developer/Xcode/DerivedData | |
key: ${{ runner.os }}-xcode-${{ hashFiles('**/project.pbxproj') }} | |
restore-keys: | | |
${{ runner.os }}-xcode- | |
- name: Build | |
run: | | |
xcodebuild -scheme Scribe -derivedDataPath Build/ -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' clean build | |
- name: Test and Generate Coverage | |
run: | | |
xcodebuild -scheme Scribe -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' test -enableCodeCoverage YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
xcrun xccov view --report $(find ./Build/Logs/Test -name '*.xcresult') --json > code_coverage.json | |
- name: Parse Coverage and Print to Terminal | |
run: swift Tests/ProcessCoverageReport.swift code_coverage.json 5 |