diff --git a/.github/workflows/ios-tests.yml b/.github/workflows/ios-tests.yml new file mode 100644 index 00000000..7d3ba3e1 --- /dev/null +++ b/.github/workflows/ios-tests.yml @@ -0,0 +1,67 @@ +name: iOS CI + +on: [push, pull_request] + +env: + CLOUDINARY_URL: ${{ secrets.CLOUDINARY_URL }} + +jobs: + build: + name: Xcode ${{ matrix.xcode_version }} - iOS ${{ matrix.os_version }} + runs-on: macos-13 + + strategy: + matrix: + include: + - xcode_version: '15.4' + ios_name: 'iPhone 14' + os_version: '16.4' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Ruby (for CocoaPods) + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.2 + + - name: Setup Xcode ${{ matrix.xcode_version }} + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ matrix.xcode_version }} + + - name: Install CocoaPods + run: sudo gem install cocoapods + + - name: Setup CLOUDINARY_URL + run: | + echo "CLOUDINARY_URL=$(bash tools/get_test_cloud.sh)" >> $GITHUB_ENV + echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)" + + - name: Clean Derived Data + run: rm -rf ~/Library/Developer/Xcode/DerivedData + + - name: Install Pods + working-directory: Example + run: pod install + + - name: Build for Testing + run: | + xcodebuild build-for-testing \ + -workspace Example/Cloudinary.xcworkspace \ + -scheme travis_public_scheme \ + -destination "platform=iOS Simulator,OS=${{ matrix.os_version }},name=${{ matrix.ios_name }}" \ + CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty + + - name: Run Tests + run: | + xcodebuild test-without-building \ + -workspace Example/Cloudinary.xcworkspace \ + -scheme travis_public_scheme \ + -destination "platform=iOS Simulator,OS=${{ matrix.os_version }},name=${{ matrix.ios_name }}" \ + CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty + + - name: Notify on Failure + if: failure() + run: echo "Notify sdk_developers@cloudinary.com of failure" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 354fb569..00000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: objective-c -os: osx -before_script: > - export CLOUDINARY_URL=$(bash tools/get_test_cloud.sh); - echo cloud_name: "$(echo $CLOUDINARY_URL | cut -d'@' -f2)" -notifications: - email: - recipients: - - sdk_developers@cloudinary.com -jobs: - - osx_image: xcode12 - xcode_workspace: Example/Cloudinary.xcworkspace - xcode_scheme: travis_public_scheme - podfile: Example/Podfile - install: pod install --project-directory=Example - env: CLOUDINARY_URL=$CLOUDINARY_URL - xcode_destination: platform=iOS Simulator,OS=13.0,name=iPhone 8 - - osx_image: xcode12 - xcode_workspace: Example/Cloudinary.xcworkspace - xcode_scheme: travis_public_scheme - podfile: Example/Podfile - install: pod install --project-directory=Example - env: CLOUDINARY_URL=$CLOUDINARY_URL - xcode_destination: platform=iOS Simulator,OS=14.0,name=iPhone 8 - - osx_image: xcode13.2 - xcode_workspace: Example/Cloudinary.xcworkspace - xcode_scheme: travis_public_scheme - podfile: Example/Podfile - install: pod install --project-directory=Example - env: CLOUDINARY_URL=$CLOUDINARY_URL - xcode_destination: platform=iOS Simulator,OS=15.2,name=iPhone 8