Skip to content

Commit

Permalink
Update Build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mrajatttt authored May 30, 2024
1 parent 2554af4 commit b783c75
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:
jobs:
checkout:
runs-on: macos-latest
outputs:
workdir: ${{ steps.set_workdir.outputs.workdir }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -23,6 +25,16 @@ jobs:
- 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 ${{ steps.set_workdir.outputs.workdir }}

- name: Debug - List AmazonConnectChatIOS directory contents
run: ls -al ${{ steps.set_workdir.outputs.workdir }}

setup:
runs-on: macos-latest
needs: checkout
Expand All @@ -33,16 +45,6 @@ jobs:
- 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:
Expand All @@ -52,8 +54,8 @@ jobs:
run: sudo gem install cocoapods

- name: Install Pods
working-directory: ${{ env.WORKDIR }}
run: pod install
working-directory: ${{ needs.checkout.outputs.workdir }}

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand All @@ -74,13 +76,13 @@ jobs:
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
working-directory: ${{ needs.checkout.outputs.workdir }}

test:
runs-on: macos-latest
Expand All @@ -93,7 +95,6 @@ jobs:
run: ls -al

- name: Run Unit Tests
working-directory: ${{ env.WORKDIR }}
run: |
xcodebuild test -workspace AmazonConnectChatIOS.xcworkspace \
-scheme AmazonConnectChatIOS \
Expand All @@ -105,9 +106,10 @@ jobs:
TEST_RESULT=${PIPESTATUS[0]}
if [ $TEST_RESULT -ne 0 ]; then
echo "xcodebuild test failed with exit code $TEST_RESULT"
working-directory: ${{ needs.checkout.outputs.workdir }}
continue-on-error: true

- name: Print Test Results
if: always()
working-directory: ${{ env.WORKDIR }}
run: cat raw-test-output.log
working-directory: ${{ needs.checkout.outputs.workdir }}

0 comments on commit b783c75

Please sign in to comment.