Skip to content

Create demo app, add new initializer (#7) #7

Create demo app, add new initializer (#7)

Create demo app, add new initializer (#7) #7

name: Build and Test - macOS
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.github/workflows/documentation.yml'
pull_request:
branches:
- main
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.github/workflows/documentation.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build and Test
runs-on: macos-13
env:
XCODE_PROJECT: RemoteImage.xcodeproj
XCODE_SCHEME: RemoteImage
COVERAGE_TARGET: RemoteImage
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install xcbeautify
run: brew install xcbeautify
- uses: actions/cache@v3
name: "Cache SPM Dependencies"
with:
path: build/SourcePackages
key: ${{ runner.os }}-spm-${{ hashFiles('RemoteImage.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build
run: set -o pipefail && xcodebuild -project ${{ env.XCODE_PROJECT }} -scheme ${{ env.XCODE_SCHEME }} -destination 'platform=macOS' -derivedDataPath build -skipPackagePluginValidation build-for-testing | xcbeautify
- name: Test
run: set -o pipefail && xcodebuild -project ${{ env.XCODE_PROJECT }} -scheme ${{ env.XCODE_SCHEME }} -destination 'platform=macOS' -derivedDataPath build -skipPackagePluginValidation -enableCodeCoverage YES test-without-building | xcbeautify
- name: Prepare Code Coverage
run: set -o pipefail && xcrun llvm-cov export -format="lcov" --ignore-filename-regex="Tests|Mocks" -instr-profile=$(find build/Build -name Coverage.profdata) $(find build/Build -name ${{ env.COVERAGE_TARGET }}) > info.lcov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: macOS
verbose: true
fail_ci_if_error: true