Skip to content

actions: Add code coverage #12

actions: Add code coverage

actions: Add code coverage #12

Workflow file for this run

name: iOS build and test workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
SCHEME: CryptoWidgetKitApp
TEST_SCHEME: CryptoWidgetKitAppTests
SIMULATOR: "iPhone 15"
jobs:
build:
name: Build and test using Xcode ${{ matrix.xcode_version }} iOS ${{ matrix.os_version }}
runs-on: macos-14
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators
xcode_version: [ "15.4" ]
os_version: [ "17.0.1"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Xcode
uses: maxim-lobanov/[email protected]
with:
xcode-version: ${{ matrix.xcode_version }}
- name: Build
run: |
# https://mokacoding.com/blog/xcodebuild-destination-options/
xcodebuild \
-scheme "$SCHEME" \
-destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \
clean build
- name: Test
run: |
xcodebuild \
-scheme "$TEST_SCHEME" \
-destination "platform=iOS Simulator,name=${SIMULATOR},OS=${{ matrix.os_version }}" \
-enableCodeCoverage YES \
test
- name: Lcov file generation
run: |
xcrun llvm-cov export -format="lcov" .build/debug/EmailValidationPackageTests.xctest/Contents/MacOS/EmailValidationPackageTests -instr-profile .build/debug/codecov/default.profdata -ignore-filename-regex=".build|Tests" > info.lcov
- name: Coveralls
uses: coverallsapp/github-action@v2