Update Build.yml #19
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 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 - 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 | |
run: pod install | |
working-directory: ${{ env.WORKDIR }} | |
- 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 | |
run: | | |
xcodebuild clean -workspace AmazonConnectChatIOS.xcworkspace \ | |
-scheme AmazonConnectChatIOS \ | |
-sdk iphonesimulator \ | |
-configuration Debug \ | |
build | |
working-directory: ${{ env.WORKDIR }} | |
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 | |
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" | |
working-directory: ${{ env.WORKDIR }} | |
continue-on-error: true | |
- name: Print Test Results | |
if: always() | |
run: cat raw-test-output.log | |
working-directory: ${{ env.WORKDIR }} |