From a988b63b6e1530acc6dc6b63b9e23da86df543c2 Mon Sep 17 00:00:00 2001 From: Mariana Souza Date: Tue, 22 Oct 2024 15:38:19 -0400 Subject: [PATCH] Based on add-ci-workflow --- .circleci/config.yml | 125 ------------------ .github/workflows/ios-sdk-ci.yml | 76 +++++++++++ Gemfile | 2 +- Gemfile.lock | 36 ++--- .../xcschemes/OptableSDK.xcscheme | 2 +- demo-ios-objc/Podfile.lock | 2 +- .../demo-ios-objc/GAMBannerViewController.m | 4 +- demo-ios-swift/Podfile.lock | 2 +- .../GAMBannerViewController.swift | 4 +- fastlane/Fastfile | 3 +- 10 files changed, 104 insertions(+), 152 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ios-sdk-ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 14a0204..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,125 +0,0 @@ -version: 2.1 - -orbs: - slack: circleci/slack@4.1.1 - -jobs: - sdk-tests: - macos: - xcode: 12.1.0 - environment: - FL_OUTPUT_DIR: output - FASTLANE_LANE: tests - steps: - - checkout - - run: bundle install - - run: - name: Fastlane - command: bundle exec fastlane $FASTLANE_LANE - - store_artifacts: - path: output - - store_test_results: - path: output/scan - - slack/notify: - event: fail - template: basic_fail_1 - - build-demo-swift: - macos: - xcode: 12.1.0 - environment: - FL_OUTPUT_DIR: output - FASTLANE_LANE: demo_swift - steps: - - checkout - - run: bundle install - - run: - name: Fastlane - command: bundle exec fastlane $FASTLANE_LANE - - store_artifacts: - path: output - - slack/notify: - event: fail - template: basic_fail_1 - - build-demo-objc: - macos: - xcode: 12.1.0 - environment: - FL_OUTPUT_DIR: output - FASTLANE_LANE: demo_objc - steps: - - checkout - - run: bundle install - - run: - name: Fastlane - command: bundle exec fastlane $FASTLANE_LANE - - store_artifacts: - path: output - - slack/notify: - event: fail - template: basic_fail_1 - - success-slack-notify: - docker: - - image: cimg/base:stable - steps: - - run: - name: Success - command: | - exit 0 - - slack/notify: - event: pass - template: success_tagged_deploy_1 - -workflows: - standard-build: - jobs: - - sdk-tests: - context: slack-secrets - - build-demo-swift: - requires: - - sdk-tests - context: slack-secrets - - build-demo-objc: - requires: - - sdk-tests - context: slack-secrets - - release-build: - jobs: - - sdk-tests: - context: slack-secrets - filters: - branches: - ignore: /.*/ - tags: - only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/ - - build-demo-swift: - requires: - - sdk-tests - context: slack-secrets - filters: - branches: - ignore: /.*/ - tags: - only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/ - - build-demo-objc: - requires: - - sdk-tests - context: slack-secrets - filters: - branches: - ignore: /.*/ - tags: - only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/ - - success-slack-notify: - requires: - - build-demo-swift - - build-demo-objc - context: slack-secrets - filters: - branches: - ignore: /.*/ - tags: - only: /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/ diff --git a/.github/workflows/ios-sdk-ci.yml b/.github/workflows/ios-sdk-ci.yml new file mode 100644 index 0000000..c7a8eb4 --- /dev/null +++ b/.github/workflows/ios-sdk-ci.yml @@ -0,0 +1,76 @@ +name: "iOS SDK CI" + +on: + pull_request: + # push: # TODO: To be validated + # branches-ignore: '*' + # tags: + # - '^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$' + +jobs: + setup: + name: "Setup" + runs-on: macos-14 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Install ruby and gem dependencies + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.7 + bundler-cache: true # runs 'bundle install' and caches installed gems automatically + + sdk-tests: + name: "SDK Tests" + runs-on: macos-14 + needs: [setup] + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Bundle install + run: bundle install + - name: Run Tests + run: bundle exec fastlane tests + - name: Store Artifacts + uses: actions/upload-artifact@v4 + with: + name: test-results + path: ./fastlane/test_output + + build-demo-swift: + name: "Build Demo Swift" + runs-on: macos-14 + + needs: [setup, sdk-tests] + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Bundle install + run: bundle install + - name: Build Demo Swift + id: build-demo-swift + run: bundle exec fastlane demo_swift + # - name: Store Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: demo-swift + # path: + + build-demo-objc: + name: "Build Demo Objective-C" + runs-on: macos-14 + env: + FL_OUTPUT_DIR: output + needs: [setup, sdk-tests] + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Bundle install + run: bundle install + - name: Build Demo Objective-C + run: bundle exec fastlane demo_objc + # - name: Store Artifacts + # uses: actions/upload-artifact@v4 + # with: + # name: demo-objc + # path: diff --git a/Gemfile b/Gemfile index 3caa760..a67f32a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ source "https://rubygems.org" gem 'fastlane' -gem 'cocoapods' +gem "cocoapods", "= 1.12.0" diff --git a/Gemfile.lock b/Gemfile.lock index 4d0e1a8..967e6f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,7 +3,7 @@ GEM specs: CFPropertyList (3.0.5) rexml - activesupport (6.1.4.4) + activesupport (6.1.7.9) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -34,15 +34,15 @@ GEM aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.0.3) - cocoapods (1.11.2) + cocoapods (1.12.0) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.2) + cocoapods-core (= 1.12.0) cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-downloader (>= 1.6.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-trunk (>= 1.6.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) @@ -50,10 +50,10 @@ GEM gh_inspector (~> 1.0) molinillo (~> 0.8.0) nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) + ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.11.2) - activesupport (>= 5.0, < 7) + cocoapods-core (1.12.0) + activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -63,7 +63,7 @@ GEM public_suffix (~> 4.0) typhoeus (~> 1.0) cocoapods-deintegrate (1.0.5) - cocoapods-downloader (1.5.1) + cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.1) @@ -75,7 +75,7 @@ GEM colored2 (3.1.2) commander (4.6.0) highline (~> 2.0.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.3.4) declarative (0.0.20) digest-crc (0.6.4) rake (>= 12.0.0, < 14.0.0) @@ -84,7 +84,7 @@ GEM dotenv (2.7.6) emoji_regex (3.2.3) escape (0.0.4) - ethon (0.15.0) + ethon (0.16.0) ffi (>= 1.15.0) excon (0.89.0) faraday (1.8.0) @@ -151,7 +151,7 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - ffi (1.15.4) + ffi (1.17.0) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) @@ -197,7 +197,7 @@ GEM http-cookie (1.0.4) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.8.11) + i18n (1.14.6) concurrent-ruby (~> 1.0) jmespath (1.4.0) json (2.6.1) @@ -205,7 +205,7 @@ GEM memoist (0.16.2) mini_magick (4.11.0) mini_mime (1.1.2) - minitest (5.15.0) + minitest (5.25.1) molinillo (0.8.0) multi_json (1.15.0) multipart-post (2.0.0) @@ -245,9 +245,9 @@ GEM tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) - typhoeus (1.4.0) + typhoeus (1.4.1) ethon (>= 0.9.0) - tzinfo (2.0.4) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) unf (0.1.4) @@ -267,13 +267,13 @@ GEM rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) - zeitwerk (2.5.3) + zeitwerk (2.6.18) PLATFORMS ruby DEPENDENCIES - cocoapods + cocoapods (= 1.12.0) fastlane BUNDLED WITH diff --git a/OptableSDK.xcodeproj/xcshareddata/xcschemes/OptableSDK.xcscheme b/OptableSDK.xcodeproj/xcshareddata/xcschemes/OptableSDK.xcscheme index 350d1c3..df2a6e5 100644 --- a/OptableSDK.xcodeproj/xcshareddata/xcschemes/OptableSDK.xcscheme +++ b/OptableSDK.xcodeproj/xcshareddata/xcschemes/OptableSDK.xcscheme @@ -1,6 +1,6 @@