From 35847bb482ac6a935e978d60a80a25e4283f4408 Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Mon, 12 Dec 2022 11:18:26 +0100 Subject: [PATCH 1/9] test(validate): use yml validation action Use specific GitHub action for `.pubnub.yml` validation. --- .github/workflows/run-validations.yml | 22 +++++ .github/workflows/validate-pubnub-yml.yml | 24 ------ .github/workflows/validate-yml.js | 94 --------------------- Examples/Examples.xcodeproj/project.pbxproj | 2 - 4 files changed, 22 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/run-validations.yml delete mode 100644 .github/workflows/validate-pubnub-yml.yml delete mode 100644 .github/workflows/validate-yml.js diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml new file mode 100644 index 00000000..716f5773 --- /dev/null +++ b/.github/workflows/run-validations.yml @@ -0,0 +1,22 @@ +name: Validations + +on: [push] + +jobs: + validators: + name: "Validate .pubnub.yml" + runs-on: ubuntu-latest + steps: + - name: Checkout project + uses: actions/checkout@v3 + - name: Checkout validator action + uses: actions/checkout@v3 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - name: "Run '.pubnub.yml' file validation" + uses: ./.github/.release/actions/actions/validators/pubnub-yml + with: + token: ${{ secrets.GH_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/validate-pubnub-yml.yml b/.github/workflows/validate-pubnub-yml.yml deleted file mode 100644 index 88232a17..00000000 --- a/.github/workflows/validate-pubnub-yml.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: validate-pubnub-yml - -# Controls when the action will run. Workflow runs when manually triggered using the UI -# or API. -on: [push] - -jobs: - build: - name: Validate PubNub yml - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - name: Install dependencies - run: | - npm install ajv@6.12.6 - npm install yaml@1.10.0 - npm install node-fetch@2.6.1 - npm install chalk@2.4.2 - - name: Validate - run: GITHUB_TOKEN=${{ secrets.GH_TOKEN }} node ./.github/workflows/validate-yml.js diff --git a/.github/workflows/validate-yml.js b/.github/workflows/validate-yml.js deleted file mode 100644 index 7607296b..00000000 --- a/.github/workflows/validate-yml.js +++ /dev/null @@ -1,94 +0,0 @@ -const YAML = require('yaml') -const Ajv = require('ajv'); -const fetch = require('node-fetch'); -const fs = require('fs'); -const chalk = require('chalk'); - -const ghToken = process.env.GITHUB_TOKEN; -const ghHeaders = {'User-Agent': 'sdk-bot', 'Authorization': 'token ' + ghToken,'Accept': 'application/vnd.github.v3.raw'}; - -const sdkReposJSONBranch = "develop"; -let sdkReposJSONPath = "http://api.github.com/repos/pubnub/documentation-resources/contents/website-common/tools/build/sdk-repos.json?ref=" + sdkReposJSONBranch; -startExecution(sdkReposJSONPath); - -async function startExecution(sdkReposJSONPath){ - var sdkRepos = await requestGetFromGithub(sdkReposJSONPath); - var sdkReposAndFeatureMappingArray = parseReposAndFeatureMapping(sdkRepos); - var schemaText = await requestGetFromGithub(sdkReposAndFeatureMappingArray[2]); - - schema = JSON.parse(schemaText); - var yaml = fs.readFileSync(".pubnub.yml", 'utf8'); - - if(yaml != null){ - yml = YAML.parse(yaml); - var ajv = new Ajv({schemaId: 'id', "verbose":true, "allErrors": true}); - const validate = ajv.compile(schema); - const valid = validate(yml); - if (validate.errors!= null) { - console.log(chalk.cyan("===================================")); - console.log(chalk.red(yml["version"] + " validation errors...")); - console.log(chalk.cyan("===================================")); - console.log(validate.errors); - console.log(chalk.cyan("===================================")); - var result = {code:1, repo: yml["version"], msg: "validation errors"}; - printResult(result); - process.exit(1); - } - else { - var result = {code: 0, repo: yml["version"], msg: "validation pass"}; - printResult(result); - } - } else { - var result = {code:1, repo: "yml null", msg: "validation errors"}; - printResult(result); - process.exit(1); - } -} - -function printResult(result){ - var str = result.repo + ", " + result.msg; - if(result.code === 0){ - console.log(chalk.green(str) + ", Code: " + result.code); - } else { - console.log(chalk.red(str) + ", Code: " + result.code); - } -} - -async function requestGetFromGithub(url){ - try { - const response = await fetch(url, { - headers: ghHeaders, - method: 'get', - }); - if(response.status == 200){ - const json = await response.text(); - return json; - } else { - console.error(chalk.red("res.status: " + response.status + "\n URL: " + url)); - return null; - } - - } catch (error) { - console.error(chalk.red("requestGetFromGithub: " + error + "\n URL: " + url)); - return null; - } -} - -function parseReposAndFeatureMapping(body){ - if(body != null){ - var sdkRepos = JSON.parse(body); - var locations = sdkRepos["locations"]; - if(locations!=null){ - var sdkURLs = locations["sdks"]; - var featureMappingURL = locations["featureMapping"]; - var pubnubYAMLSchemaURL = locations["pubnubYAMLSchema"]; - return [sdkURLs, featureMappingURL, pubnubYAMLSchemaURL]; - } else { - console.log(chalk.red("response locations null")); - return null; - } - } else { - console.log(chalk.red("response body null")); - return null; - } -} \ No newline at end of file diff --git a/Examples/Examples.xcodeproj/project.pbxproj b/Examples/Examples.xcodeproj/project.pbxproj index 62c55337..40c104da 100644 --- a/Examples/Examples.xcodeproj/project.pbxproj +++ b/Examples/Examples.xcodeproj/project.pbxproj @@ -214,8 +214,6 @@ Base, ); mainGroup = 359F778B22B7FEF600B6B46F; - packageReferences = ( - ); productRefGroup = 359F779522B7FEF600B6B46F /* Products */; projectDirPath = ""; projectRoot = ""; From 233f1f93750f62f7b93c58b73d24dfff3e00d8af Mon Sep 17 00:00:00 2001 From: Client Engineering Bot <60980775+client-engineering-bot@users.noreply.github.com> Date: Mon, 12 Dec 2022 15:57:13 +0000 Subject: [PATCH 2/9] PubNub SDK 6.0.2 release. --- .pubnub.yml | 11 +++++++++-- PubNub.xcodeproj/project.pbxproj | 16 ++++++++-------- PubNubSwift.podspec | 2 +- Sources/PubNub/Helpers/Constants.swift | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 20236682..2ad4e5e1 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,16 @@ --- name: swift scm: github.com/pubnub/swift -version: "6.0.1" +version: "6.0.2" schema: 1 changelog: + - date: 2022-12-12 + version: 6.0.2 + changes: + - type: bug + text: "Fix memory leak within Subscription Session." + - type: improvement + text: "Use specific GitHub action for `.pubnub.yml` validation." - date: 2022-09-05 version: 6.0.1 changes: @@ -461,7 +468,7 @@ sdks: - distribution-type: source distribution-repository: GitHub release package-name: PubNub - location: https://github.com/pubnub/swift/archive/refs/tags/6.0.1.zip + location: https://github.com/pubnub/swift/archive/refs/tags/6.0.2.zip supported-platforms: supported-operating-systems: macOS: diff --git a/PubNub.xcodeproj/project.pbxproj b/PubNub.xcodeproj/project.pbxproj index 70a6c558..52b009a7 100644 --- a/PubNub.xcodeproj/project.pbxproj +++ b/PubNub.xcodeproj/project.pbxproj @@ -3238,7 +3238,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.pubnub.swift.PubNubUser; @@ -3284,7 +3284,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.pubnub.swift.PubNubUser; @@ -3381,7 +3381,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.pubnub.swift.PubNubSpace; @@ -3429,7 +3429,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.pubnub.swift.PubNubSpace; @@ -3539,7 +3539,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.pubnub.swift.PubNubMembership; @@ -3586,7 +3586,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.pubnub.swift.PubNubMembership; @@ -4027,7 +4027,7 @@ "$(inherited)", "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; @@ -4065,7 +4065,7 @@ "$(inherited)", "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx", ); - MARKETING_VERSION = 6.0.1; + MARKETING_VERSION = 6.0.2; OTHER_CFLAGS = "$(inherited)"; OTHER_LDFLAGS = "$(inherited)"; OTHER_SWIFT_FLAGS = "$(inherited)"; diff --git a/PubNubSwift.podspec b/PubNubSwift.podspec index 6ec362e6..8dd45803 100644 --- a/PubNubSwift.podspec +++ b/PubNubSwift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'PubNubSwift' - s.version = '6.0.1' + s.version = '6.0.2' s.homepage = 'https://github.com/pubnub/swift' s.documentation_url = 'https://www.pubnub.com/docs/swift-native/pubnub-swift-sdk' s.authors = { 'PubNub, Inc.' => 'support@pubnub.com' } diff --git a/Sources/PubNub/Helpers/Constants.swift b/Sources/PubNub/Helpers/Constants.swift index 59d8e2fe..b9be1953 100644 --- a/Sources/PubNub/Helpers/Constants.swift +++ b/Sources/PubNub/Helpers/Constants.swift @@ -57,7 +57,7 @@ public enum Constant { static let pubnubSwiftSDKName: String = "PubNubSwift" - static let pubnubSwiftSDKVersion: String = "6.0.1" + static let pubnubSwiftSDKVersion: String = "6.0.2" static let appBundleId: String = { if let info = Bundle.main.infoDictionary, From 8346ab914920b672ced18b11094a2ee46c93dc5c Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Mon, 12 Dec 2022 18:06:49 +0100 Subject: [PATCH 3/9] test(github-actions): move to GitHub Actions Move tests execution to GitHub Actions instead of Travis. --- .github/workflows/acceptance-tests.yaml | 57 ---------- .github/workflows/commands-handler.yml | 4 +- .github/workflows/run-tests.yml | 142 ++++++++++++++++++++++++ .travis.yml | 44 -------- 4 files changed, 144 insertions(+), 103 deletions(-) delete mode 100644 .github/workflows/acceptance-tests.yaml create mode 100644 .github/workflows/run-tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/acceptance-tests.yaml b/.github/workflows/acceptance-tests.yaml deleted file mode 100644 index 396a1fb6..00000000 --- a/.github/workflows/acceptance-tests.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Acceptance tests - -on: - push: - workflow_dispatch: - -jobs: - acceptance-tests: - name: Run Acceptance tests - runs-on: macos-12 - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - name: Cache installed Pods - uses: actions/cache@v3 - with: - path: Pods - key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} - restore-keys: | - ${{ runner.os }}-pods- - - name: Cache installed Gems - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gem- - - name: Checkout mock-server action - uses: actions/checkout@v3 - with: - repository: pubnub/client-engineering-deployment-tools - ref: v1 - token: ${{ secrets.GH_TOKEN }} - path: deployment-tools - - name: Run mock server action - uses: ./deployment-tools/actions/mock-server - with: - token: ${{ secrets.GH_TOKEN }} - features-path: Tests/PubNubContractTest/Features/ - - name: Preapre Xcode environment - run: | - bundle install --jobs=3 --retry=3 - pod install - - name: Run stable acceptance tests - run: | - bundle exec fastlane contract_test --env contract - mv Results/CucumberishTestResults-PubNubContractTests.json Results/main.json - - name: Run beta acceptance tests - run: | - bundle exec fastlane contract_test --env contract-beta && FASTLANE_EXITCODE="${PIPESTATUS[0]}" - mv Results/CucumberishTestResults-PubNubContractTestsBeta.json Results/beta.json - - name: Upload acceptance tests reports - uses: actions/upload-artifact@v3 - with: - name: acceptance-test-reports - path: Results/*.json - retention-days: 7 diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index 7e081c24..7a19d67c 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -7,7 +7,7 @@ on: jobs: process: name: Process command - if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, '@client-engineering-bot ') }} + if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, format('@{0} ', ${{ secrets.CLEN_BOT }})) }} runs-on: ubuntu-latest steps: - name: Checkout repository @@ -25,5 +25,5 @@ jobs: uses: ./.github/.release/actions/actions/commands with: token: ${{ secrets.GH_TOKEN }} - listener: client-engineering-bot + listener: ${{ secrets.CLEN_BOT }} jira-api-key: ${{ secrets.JIRA_API_KEY }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 00000000..b07d9d33 --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,142 @@ +name: Tests + +on: + push: + workflow_dispatch: +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash + +jobs: + tests: + name: Integration and Unit tests + runs-on: macos-12 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Setup Ruby 2.6.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6.6 + bundler-cache: true + - name: Cache installed Pods + uses: actions/cache@v3 + with: + path: Pods + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + - name: Cache Swift Package Manager + uses: actions/cache@v3 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + - name: Pre-load simulators list + run: xcrun simctl list -j + - name: Run iOS unit tests + run: bundle exec fastlane test --env ios + - name: Run tvOS unit tests + run: bundle exec fastlane test --env tvos + - name: Run macOS unit tests + run: bundle exec fastlane test --env macos + tests: + name: Package Managers validation + runs-on: macos-12 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Setup Ruby 2.6.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6.6 + bundler-cache: true + - name: Cache installed Pods + uses: actions/cache@v3 + with: + path: Pods + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + - name: Cache Swift Package Manager + uses: actions/cache@v3 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + - name: Cocoapods validation + run: bundle exec fastlane lint_cocoapods + - name: Swift Package Manager validation + run: bundle exec fastlane lint_swift_package_manager + - name: Demo application build validation + run: bundle exec fastlane build_example --env ios + acceptance-tests: + name: Acceptance tests + runs-on: macos-12 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Ruby 2.6.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6.6 + bundler-cache: true + - name: Cache installed Pods + uses: actions/cache@v3 + with: + path: Pods + key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} + restore-keys: | + ${{ runner.os }}-pods- + - name: Cache Swift Package Manager + uses: actions/cache@v3 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + - name: Checkout mock-server action + uses: actions/checkout@v3 + with: + repository: pubnub/client-engineering-deployment-tools + ref: v1 + token: ${{ secrets.GH_TOKEN }} + path: .github/.release/actions + - name: Run mock server action + uses: ./.github/.release/actions/actions/mock-server + with: + token: ${{ secrets.GH_TOKEN }} + features-path: Tests/PubNubContractTest/Features/ + - name: Preapre Xcode environment + run: | + bundle install --jobs=3 --retry=3 + pod install + - name: Run stable acceptance tests + run: | + bundle exec fastlane contract_test --env contract + mv Results/CucumberishTestResults-PubNubContractTests.json Results/main.json + - name: Run beta acceptance tests + run: | + bundle exec fastlane contract_test --env contract-beta && FASTLANE_EXITCODE="${PIPESTATUS[0]}" + mv Results/CucumberishTestResults-PubNubContractTestsBeta.json Results/beta.json + - name: Upload acceptance tests reports + uses: actions/upload-artifact@v3 + with: + name: acceptance-test-reports + path: Results/*.json + retention-days: 7 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 59ea5fb9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: objective-c -osx_image: xcode13.3 -rvm: 2.6.6 -os: osx - -cache: - bundler: true - cocoapods: true - directories: - - .build # Swift Package Manager - - /Users/travis/.rvm/ # RVM - -before_install: - - sudo gem update --system - -stages: - - name: "Unit Tests" - if: type = push - - name: Validate - if: type = pull_request - -jobs: - include: - - stage: Validate - name: Cocoapods - script: bundle exec fastlane lint_cocoapods - - name: "Swift Package Manager" - script: bundle exec fastlane lint_swift_package_manager - - name: "Build Demo App" - script: bundle exec fastlane build_example --env ios - - stage: "Unit Tests" - name: iOS - before_script: xcrun simctl list -j - script: bundle exec fastlane test --env ios - - name: macOS - script: bundle exec fastlane test --env macos - - name: tvOS - before_script: xcrun simctl list -j - script: bundle exec fastlane test --env tvos - -before_cache: - - rvm cleanup all - - bundle clean - - swift package clean From 1baf9448ccdbd969fef885d0efda615cae3b3483 Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Tue, 13 Dec 2022 12:50:14 +0100 Subject: [PATCH 4/9] build(github-actions): fix keys in workflow configuration --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b07d9d33..e4c11473 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -4,7 +4,7 @@ on: push: workflow_dispatch: concurrency: - group: ${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true defaults: run: @@ -48,7 +48,7 @@ jobs: run: bundle exec fastlane test --env tvos - name: Run macOS unit tests run: bundle exec fastlane test --env macos - tests: + validation: name: Package Managers validation runs-on: macos-12 steps: From 6973032a9eeec9c247526cdf8d9ff1c0f255f679 Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Wed, 14 Dec 2022 14:30:49 +0100 Subject: [PATCH 5/9] refactor(test): separate package managers Separate package managers validation from tests. refactor(test): separate demo application Separate demo application validation from package managers validation. refactor(test): parallel builds Use strategy matrix to run all tests and validations in parallel to reduce overall build time. --- .github/workflows/commands-handler.yml | 2 +- .github/workflows/run-tests.yml | 49 +++---------------- .github/workflows/run-validations.yml | 65 ++++++++++++++++++++++++-- Gemfile | 2 +- Gemfile.lock | 63 +++++++++++++------------ PubNub.xcodeproj/project.pbxproj | 30 ++++++++++++ PubNubSwift.podspec | 2 +- fastlane/Fastfile | 13 +++--- 8 files changed, 141 insertions(+), 85 deletions(-) diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index 7a19d67c..a58f4bf1 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -7,7 +7,7 @@ on: jobs: process: name: Process command - if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, format('@{0} ', ${{ secrets.CLEN_BOT }})) }} + if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, format('@{0} ', secrets.CLEN_BOT)) }} runs-on: ubuntu-latest steps: - name: Checkout repository diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e4c11473..a14cc9a5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,6 +14,9 @@ jobs: tests: name: Integration and Unit tests runs-on: macos-12 + strategy: + matrix: + environment: [iOS, tvOS, macOS] steps: - name: Checkout repository uses: actions/checkout@v3 @@ -41,48 +44,10 @@ jobs: restore-keys: | ${{ runner.os }}-spm- - name: Pre-load simulators list + if: ${{ matrix.environment != 'macOS' }} run: xcrun simctl list -j - - name: Run iOS unit tests - run: bundle exec fastlane test --env ios - - name: Run tvOS unit tests - run: bundle exec fastlane test --env tvos - - name: Run macOS unit tests - run: bundle exec fastlane test --env macos - validation: - name: Package Managers validation - runs-on: macos-12 - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - token: ${{ secrets.GH_TOKEN }} - - name: Setup Ruby 2.6.6 - uses: ruby/setup-ruby@v1 - with: - ruby-version: 2.6.6 - bundler-cache: true - - name: Cache installed Pods - uses: actions/cache@v3 - with: - path: Pods - key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} - restore-keys: | - ${{ runner.os }}-pods- - - name: Cache Swift Package Manager - uses: actions/cache@v3 - with: - path: | - .build - ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts - key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} - restore-keys: | - ${{ runner.os }}-spm- - - name: Cocoapods validation - run: bundle exec fastlane lint_cocoapods - - name: Swift Package Manager validation - run: bundle exec fastlane lint_swift_package_manager - - name: Demo application build validation - run: bundle exec fastlane build_example --env ios + - name: Run ${{ matrix.environment }} unit tests + run: bundle exec fastlane test --env $(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]')) acceptance-tests: name: Acceptance tests runs-on: macos-12 @@ -125,7 +90,7 @@ jobs: - name: Preapre Xcode environment run: | bundle install --jobs=3 --retry=3 - pod install + bundle exec pod install - name: Run stable acceptance tests run: | bundle exec fastlane contract_test --env contract diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 716f5773..7a1fa614 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -1,9 +1,17 @@ name: Validations -on: [push] +on: + push: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +defaults: + run: + shell: bash jobs: - validators: + repository-validators: name: "Validate .pubnub.yml" runs-on: ubuntu-latest steps: @@ -19,4 +27,55 @@ jobs: - name: "Run '.pubnub.yml' file validation" uses: ./.github/.release/actions/actions/validators/pubnub-yml with: - token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + token: ${{ secrets.GH_TOKEN }} + package-managers-validation: + name: Validate package managers + runs-on: macos-12 + strategy: + matrix: + managers: [CocoaPods, Swift Package Manager] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Setup Ruby 2.6.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6.6 + bundler-cache: true + - name: Cache Swift Package Manager + uses: actions/cache@v3 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + - name: ${{ matrix.environment }} validation + run: bundle exec fastlane lint_${$(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]')// /_} + demo-app-validation: + name: Validate demo application + runs-on: macos-12 + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + token: ${{ secrets.GH_TOKEN }} + - name: Setup Ruby 2.6.6 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.6.6 + bundler-cache: true + - name: Cache Swift Package Manager + uses: actions/cache@v3 + with: + path: | + .build + ~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + - name: Demo application build validation + run: bundle exec fastlane build_example --env ios diff --git a/Gemfile b/Gemfile index af82b603..51325e18 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "cocoapods" +gem "cocoapods", :github => "cocoapods/cocoapods", :branch => "master" gem "fastlane" gem "slather" diff --git a/Gemfile.lock b/Gemfile.lock index 4aada715..ebfb8c0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,27 @@ +GIT + remote: https://github.com/cocoapods/cocoapods.git + revision: 4a3159879a29d076d16a20b763f61eb96406a6c1 + branch: master + specs: + cocoapods (1.11.3) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.11.3) + cocoapods-deintegrate (>= 1.0.3, < 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.6.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) + nap (~> 1.0) + ruby-macho (>= 2.3.0, < 3.0) + xcodeproj (>= 1.21.0, < 2.0) + GEM remote: https://rubygems.org/ specs: @@ -17,7 +41,7 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.674.0) + aws-partitions (1.676.0) aws-sdk-core (3.168.4) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) @@ -35,24 +59,6 @@ GEM babosa (1.0.4) claide (1.1.0) clamp (1.3.2) - cocoapods (1.11.3) - addressable (~> 2.8) - claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.11.3) - cocoapods-deintegrate (>= 1.0.3, < 2.0) - cocoapods-downloader (>= 1.4.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-try (>= 1.1.0, < 2.0) - colored2 (~> 3.1) - escape (~> 0.0.4) - fourflusher (>= 2.3.0, < 3.0) - gh_inspector (~> 1.0) - molinillo (~> 0.8.0) - nap (~> 1.0) - ruby-macho (>= 1.0, < 3.0) - xcodeproj (>= 1.21.0, < 2.0) cocoapods-core (1.11.3) activesupport (>= 5.0, < 7) addressable (~> 2.8) @@ -87,7 +93,7 @@ GEM escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.94.0) + excon (0.95.0) faraday (1.10.2) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -160,9 +166,9 @@ GEM fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.31.0) + google-apis-androidpublisher_v3 (0.32.0) google-apis-core (>= 0.9.1, < 2.a) - google-apis-core (0.9.1) + google-apis-core (0.9.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -221,7 +227,6 @@ GEM memoist (0.16.2) mini_magick (4.12.0) mini_mime (1.1.2) - mini_portile2 (2.8.0) minitest (5.16.3) molinillo (0.8.0) multi_json (1.15.0) @@ -231,8 +236,7 @@ GEM nap (1.1.0) naturally (2.2.1) netrc (0.11.0) - nokogiri (1.13.10) - mini_portile2 (~> 2.8.0) + nokogiri (1.13.10-arm64-darwin) racc (~> 1.4) open4 (1.3.4) optparse (0.1.1) @@ -269,8 +273,7 @@ GEM clamp (~> 1.3) nokogiri (>= 1.13.9) xcodeproj (~> 1.21) - sqlite3 (1.5.4) - mini_portile2 (~> 2.8.0) + sqlite3 (1.5.4-arm64-darwin) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -306,13 +309,13 @@ GEM zeitwerk (2.6.6) PLATFORMS - ruby + arm64-darwin-21 DEPENDENCIES - cocoapods + cocoapods! fastlane jazzy slather BUNDLED WITH - 2.2.33 + 2.3.26 diff --git a/PubNub.xcodeproj/project.pbxproj b/PubNub.xcodeproj/project.pbxproj index 52b009a7..47066569 100644 --- a/PubNub.xcodeproj/project.pbxproj +++ b/PubNub.xcodeproj/project.pbxproj @@ -3168,6 +3168,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGET_NAME = PubNubIntTests; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3200,6 +3201,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGET_NAME = PubNubIntTests; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3249,6 +3251,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3295,6 +3298,7 @@ VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3318,6 +3322,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = NO; TARGETED_DEVICE_FAMILY = "1,2"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3342,6 +3347,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3393,6 +3399,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3441,6 +3448,7 @@ VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3471,6 +3479,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3501,6 +3510,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3551,6 +3561,7 @@ TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3597,6 +3608,7 @@ VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3628,6 +3640,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3660,6 +3673,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3667,6 +3681,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3674,6 +3689,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = "$(TARGET_NAME)"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3697,6 +3713,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = NO; TARGETED_DEVICE_FAMILY = "1,2"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3721,6 +3738,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3751,6 +3769,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3781,6 +3800,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3812,6 +3832,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3844,6 +3865,7 @@ SWIFT_EMIT_LOC_STRINGS = NO; TARGETED_DEVICE_FAMILY = "1,2,3,4"; VALIDATE_PRODUCT = YES; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3884,6 +3906,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TARGET_NAME = PubNubContractTests; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -3923,6 +3946,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TARGET_NAME = PubNubContractTests; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -3964,6 +3988,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TARGET_NAME = PubNubContractTestsBeta; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -4004,6 +4029,7 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; TARGET_NAME = PubNubContractTestsBeta; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -4042,6 +4068,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGET_NAME = PubNub; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -4080,6 +4107,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGET_NAME = PubNub; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; @@ -4226,6 +4254,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGET_NAME = PubNubTests; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Debug; }; @@ -4259,6 +4288,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)"; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TARGET_NAME = PubNubTests; + WATCHOS_DEPLOYMENT_TARGET = 4.0; }; name = Release; }; diff --git a/PubNubSwift.podspec b/PubNubSwift.podspec index 8dd45803..4f5dca8d 100644 --- a/PubNubSwift.podspec +++ b/PubNubSwift.podspec @@ -19,7 +19,7 @@ The PubNub Real-Time Network. Build real-time apps quickly and scale them global s.ios.deployment_target = '9.0' s.osx.deployment_target = '10.11' s.tvos.deployment_target = '9.0' - s.watchos.deployment_target = '2.0' + s.watchos.deployment_target = '4.0' s.swift_version = '5.0' diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 818df19e..9ca167e3 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -20,8 +20,8 @@ before_all do |lane, opts| Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 - setup_travis if ENV["TRAVIS_CI"] - + setup_ci if ENV["CI"] + ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "120" ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120" ENV["FASTLANE_XCODEBUILD_SETTINGS_RETRIES"] = "10" @@ -67,7 +67,7 @@ lane :code_coverage do # Generate code coverage files slather( - travis: ENV["TRAVIS_CI"], + github: ENV["CI"], workspace: ENV['WORKSPACE'], proj: ENV['PROJECT_SDK'], scheme: ENV['SCHEME_SDK'], @@ -84,8 +84,7 @@ desc "Lints a release using Cocoapods" lane :lint_cocoapods do pod_lib_lint( podspec: 'PubNubSwift.podspec', - use_bundle_exec: true, - verbose: true, + verbose: false, allow_warnings: true ) end @@ -93,7 +92,7 @@ end desc "Lints a release using Swift Package Manager" lane :lint_swift_package_manager do Dir.chdir("..") do - Action.sh('swift build -c release --verbose') + Action.sh('swift build -c release -j 2') end end @@ -101,7 +100,7 @@ desc "Generates Code Coverage Files" lane :code_coverage_local do # Generate code coverage files slather( - travis: ENV["TRAVIS_CI"], + github: ENV["CI"], workspace: ENV['WORKSPACE'], proj: ENV['PROJECT_SDK'], scheme: ENV['SCHEME_SDK'], From 0342eb9d7b318a60a9b3f0cebe3a1a6f7c09c00e Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Wed, 14 Dec 2022 14:39:51 +0100 Subject: [PATCH 6/9] fix(test): rever PLATFORMS in Gemgile.lock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ebfb8c0d..0e665ad5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -309,7 +309,7 @@ GEM zeitwerk (2.6.6) PLATFORMS - arm64-darwin-21 + ruby DEPENDENCIES cocoapods! From be65389149ab5adcf27ad8123b11f563d97c8a74 Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Wed, 14 Dec 2022 14:42:55 +0100 Subject: [PATCH 7/9] refactor(test): add 'x86_64-darwin-19' platform into 'Gemfile.lock' --- Gemfile.lock | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 0e665ad5..4daa63c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -238,6 +238,8 @@ GEM netrc (0.11.0) nokogiri (1.13.10-arm64-darwin) racc (~> 1.4) + nokogiri (1.13.10-x86_64-darwin) + racc (~> 1.4) open4 (1.3.4) optparse (0.1.1) os (1.1.4) @@ -274,6 +276,7 @@ GEM nokogiri (>= 1.13.9) xcodeproj (~> 1.21) sqlite3 (1.5.4-arm64-darwin) + sqlite3 (1.5.4-x86_64-darwin) terminal-notifier (2.0.0) terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) @@ -309,7 +312,8 @@ GEM zeitwerk (2.6.6) PLATFORMS - ruby + arm64-darwin-21 + x86_64-darwin-19 DEPENDENCIES cocoapods! From 7e5c2a6e8ce72e5d04ff570553303d47112774bb Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Wed, 14 Dec 2022 14:50:33 +0100 Subject: [PATCH 8/9] fix(tests): fix workflows configuration --- .github/workflows/run-tests.yml | 2 +- .github/workflows/run-validations.yml | 4 ++-- fastlane/.env.ios | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a14cc9a5..62774535 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -47,7 +47,7 @@ jobs: if: ${{ matrix.environment != 'macOS' }} run: xcrun simctl list -j - name: Run ${{ matrix.environment }} unit tests - run: bundle exec fastlane test --env $(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]')) + run: bundle exec fastlane test --env $(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]') acceptance-tests: name: Acceptance tests runs-on: macos-12 diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 7a1fa614..58962000 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -53,8 +53,8 @@ jobs: key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} restore-keys: | ${{ runner.os }}-spm- - - name: ${{ matrix.environment }} validation - run: bundle exec fastlane lint_${$(echo ${{ matrix.environment }} | tr '[:upper:]' '[:lower:]')// /_} + - name: ${{ matrix.managers }} validation + run: bundle exec fastlane lint_${$(echo ${{ matrix.managers }} | tr '[:upper:]' '[:lower:]')// /_} demo-app-validation: name: Validate demo application runs-on: macos-12 diff --git a/fastlane/.env.ios b/fastlane/.env.ios index 53334c84..cc23826a 100644 --- a/fastlane/.env.ios +++ b/fastlane/.env.ios @@ -1,7 +1,7 @@ DEVICES="iPhone 12 (14.5),iPhone 12 (15.4)" COVERAGE="iPhone 11 (15.4)" -DESTINATION_EXAMPLE="OS=15.4,name=iPhone 12" +DESTINATION_EXAMPLE="OS=16.0,name=iPhone 12" TEST_OUTPUT_DIR="fastlane/test_output/iOS" SCHEME_EXAMPLE=Example-iOS PLATFORM=ios From b3c731d661b6bd2c694a2ade4c547b04a39bfe70 Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Wed, 14 Dec 2022 14:58:06 +0100 Subject: [PATCH 9/9] fix(tests): fix string replacement code --- .github/workflows/run-validations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 58962000..2cb39222 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -54,7 +54,7 @@ jobs: restore-keys: | ${{ runner.os }}-spm- - name: ${{ matrix.managers }} validation - run: bundle exec fastlane lint_${$(echo ${{ matrix.managers }} | tr '[:upper:]' '[:lower:]')// /_} + run: bundle exec fastlane lint_$(echo ${{ matrix.managers }} | tr '[:upper:]' '[:lower:]' | tr ' ' '_') demo-app-validation: name: Validate demo application runs-on: macos-12