Run actions on M1 #12
Workflow file for this run
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: 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-xlarge | |
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 |