-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (92 loc) · 2.87 KB
/
Build.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Build and Test Amazon Connect Chat SDK for iOS
on:
push:
branches:
- main
- rajatttt/test
pull_request:
branches:
- main
- rajatttt/test
jobs:
checkout:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Debug - Print current directory
run: pwd
- name: Debug - List root directory contents
run: ls -al
setup:
runs-on: macos-latest
needs: checkout
steps:
- name: Debug - Print current directory
run: pwd
- name: Debug - List root directory contents
run: ls -al
- name: Set working directory
id: set_workdir
run: echo "WORKDIR=${{ github.workspace }}/AmazonConnectChatIOS" >> $GITHUB_ENV
- name: Debug - Verify WORKDIR environment variable
run: echo ${{ env.WORKDIR }}
- name: Debug - List AmazonConnectChatIOS directory contents
run: ls -al ${{ env.WORKDIR }}
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest'
- name: Install CocoaPods
run: sudo gem install cocoapods
- name: Install Pods
working-directory: ${{ env.WORKDIR }}
run: pod install
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install xcpretty
run: gem install xcpretty
build:
runs-on: macos-latest
needs: setup
steps:
- name: Debug - Print current directory
run: pwd
- name: Debug - List root directory contents
run: ls -al
- name: Clean and Build SDK
working-directory: ${{ env.WORKDIR }}
run: |
xcodebuild clean -workspace AmazonConnectChatIOS.xcworkspace \
-scheme AmazonConnectChatIOS \
-sdk iphonesimulator \
-configuration Debug \
build
test:
runs-on: macos-latest
needs: build
steps:
- name: Debug - Print current directory
run: pwd
- name: Debug - List root directory contents
run: ls -al
- name: Run Unit Tests
working-directory: ${{ env.WORKDIR }}
run: |
xcodebuild test -workspace AmazonConnectChatIOS.xcworkspace \
-scheme AmazonConnectChatIOS \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 12,OS=latest' \
-configuration Debug \
-enableCodeCoverage YES \
2>&1 | tee raw-test-output.log | xcpretty --color --simple
TEST_RESULT=${PIPESTATUS[0]}
if [ $TEST_RESULT -ne 0 ]; then
echo "xcodebuild test failed with exit code $TEST_RESULT"
continue-on-error: true
- name: Print Test Results
if: always()
working-directory: ${{ env.WORKDIR }}
run: cat raw-test-output.log