-
Notifications
You must be signed in to change notification settings - Fork 9
35 lines (32 loc) · 1.58 KB
/
unit_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Run Unit Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
unit-test-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Unit test Authenticator on iOS
run: xcodebuild test -scheme Authenticator -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' -derivedDataPath Build/ -enableCodeCoverage YES -clonedSourcePackagesDirPath ~/Library/Developer/Xcode/DerivedData/Authenticator | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}
- name: Generate Coverage Report
continue-on-error: true
run: |
cd Build/Build/ProfileData
cd $(ls -d */|head -n 1)
pathCoverage=Build/Build/ProfileData/${PWD##*/}/Coverage.profdata
cd ${{ github.workspace }}
xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug-iphonesimulator/Authenticator.o > Authenticator-Coverage.lcov
- name: Upload Report
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
with:
flags: Authenticator
token: ${{ secrets.CODECOV_TOKEN }}
unit-test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Unit test Authenticator on macOS
run: xcodebuild test -scheme Authenticator -sdk 'macosx' -destination 'platform=macOS,arch=x86_64' | xcpretty --simple --color --report junit && exit ${PIPESTATUS[0]}