-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (57 loc) · 2.54 KB
/
ci.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: CI
on:
push:
branches: [ main ]
pull_request:
jobs:
build:
runs-on: macos-12
env:
UNIT_TESTS_RESULTS: UnitTestsResults_${{ github.run_number }}#${{ github.run_attempt }}
SNAPSHOT_TESTS_RESULTS: SnapshotTestsResults_${{ github.run_number }}#${{ github.run_attempt }}
DESTINATION: platform=iOS Simulator,name=iPhone 12,OS=16.0
DEVELOPER_DIR: /Applications/Xcode_14.0.1.app/Contents/Developer
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
pod repo add fourthline-specs https://${{ secrets.FOURTHLINE_COCOAPODS_USER }}:${{ secrets.FOURTHLINE_COCOAPODS_TOKEN }}@github.com/Fourthline-com/FourthlineSDK-iOS-Specs.git
pod install
- name: Build For Testing
run: |
xcodebuild -workspace IdentHubSDK.xcworkspace -scheme IdentHubSDK -destination "$DESTINATION" build-for-testing
- name: Run Unit Tests
id: unit_tests
run: |
xcodebuild -workspace IdentHubSDK.xcworkspace -scheme IdentHubSDK -destination "$DESTINATION" -resultBundlePath $UNIT_TESTS_RESULTS.xcresult test-without-building
- name: Archive Unit Tests Results
if: ${{ failure() && steps.unit_tests.conclusion == 'failure' }}
run: |
zip -r $UNIT_TESTS_RESULTS.zip $UNIT_TESTS_RESULTS.xcresult/
- name: Upload Unit Tests Results
if: ${{ failure() && steps.unit_tests.conclusion == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.UNIT_TESTS_RESULTS }}
path: ${{ env.UNIT_TESTS_RESULTS }}.zip
retention-days: 1
if-no-files-found: ignore
- name: Run Snapshot Tests
id: snapshot_tests
run: |
xcodebuild -workspace IdentHubSDK.xcworkspace -scheme IdentHubSDK -destination "$DESTINATION" -resultBundlePath $SNAPSHOT_TESTS_RESULTS.xcresult -testPlan IdentHubSDKSnapshotTests test-without-building
- name: Archive Snapshot Tests Results
if: ${{ failure() && steps.snapshot_tests.conclusion == 'failure' }}
run: |
zip -r $SNAPSHOT_TESTS_RESULTS.zip $SNAPSHOT_TESTS_RESULTS.xcresult/
- name: Upload Snapshot Tests Results
if: ${{ failure() && steps.snapshot_tests.conclusion == 'failure' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.SNAPSHOT_TESTS_RESULTS }}
path: ${{ env.SNAPSHOT_TESTS_RESULTS }}.zip
retention-days: 1
if-no-files-found: ignore
- name: Build Sample App
run: |
xcodebuild -workspace IdentHubSDK.xcworkspace -scheme Sample -destination "$DESTINATION" build