Skip to content

Commit

Permalink
Release Branch Workflow Improvements (#1896)
Browse files Browse the repository at this point in the history
# Summary

- The diff tool targets the last release if the branch is `release/*`
- Compatibility tests now run when the branch is `release/*`
- Added iOS 17 to compatibility tests
- Added iPad (iOS 17) to compatibility tests
- Updating `adyen-swift-public-api-diff` to
[0.3.0](https://github.com/Adyen/adyen-swift-public-api-diff/releases/tag/0.3.0)

# Ticket

<ticket>
COIOS-000
</ticket>

---------

Co-authored-by: Alex Guretzki <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: goergisn <[email protected]>
  • Loading branch information
4 people authored Nov 14, 2024
1 parent 02e8899 commit 0b3bd49
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 15 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- develop
- release/**

jobs:
tests:
Expand All @@ -15,6 +16,22 @@ jobs:
matrix:
include:

- version: '17.2'
runtime: 'iOS-17-2'
device: 'iPhone 15'
displayname: 'iPhone-15'
os: 'macos-14-xlarge'
xcode_version: '15.1'
needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15

- version: '17.2'
runtime: 'iOS-17-2'
device: 'iPad Air (5th generation)'
displayname: 'iPad-Air-5'
os: 'macos-14-xlarge'
xcode_version: '15.1'
needs_custom_sim: false # Takes the shipped simulator that comes with Xcode 15

- version: '16.4'
runtime: 'iOS-16-4'
device: 'iPhone 14'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/detect_api_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
PROJECT_FOLDER=$PWD
NEW="${{ env.source }}~${{ env.githubRepo }}"
if [[ '${{ github.head_ref || env.noTargetBranch }}' == 'release/*' ]]
if [[ '${{ github.head_ref || env.noTargetBranch }}' == release/* ]]
then
LATEST_TAG=$(git describe --tags --abbrev=0)
OLD="$LATEST_TAG~${{ env.githubRepo }}"
Expand All @@ -47,7 +47,7 @@ jobs:
fi
cd Scripts
./public-api-diff project --new "$NEW" --old "$OLD" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt"
./public-api-diff project --new "$NEW" --old "$OLD" --platform iOS --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt"
cat "$PROJECT_FOLDER/logs.txt"
cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ extension VoucherComponent: VoucherViewDelegate, DocumentActionViewDelegate {
)
createAlertActions(for: action, sourceView: sourceView).forEach { alert.addAction($0) }

alert.popoverPresentationController?.sourceView = sourceView
presenterViewController.present(alert, animated: true, completion: nil)
}

Expand Down
Binary file modified Scripts/public-api-diff
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,16 @@ class VoucherComponentTests: XCTestCase {
wait(for: .milliseconds(300))

let alertSheet = try! XCTUnwrap(UIViewController.topPresenter() as? UIAlertController)
XCTAssertEqual(alertSheet.actions.count, 4)
XCTAssertEqual(alertSheet.actions[0].title, "Copy code")
XCTAssertEqual(alertSheet.actions[1].title, "Download PDF")
XCTAssertEqual(alertSheet.actions[2].title, "Read instructions")
XCTAssertEqual(alertSheet.actions[3].title, "Cancel")

let expectedActionTitles = [
"Copy code",
"Download PDF",
"Read instructions",
"Cancel"
]

XCTAssertEqual(alertSheet.actions.map(\.title), expectedActionTitles)
XCTAssertEqual(alertSheet.actions.count, expectedActionTitles.count)

presentationDelegateExpectation.fulfill()
}
Expand Down Expand Up @@ -158,12 +163,16 @@ class VoucherComponentTests: XCTestCase {

optionsButton.sendActions(for: .touchUpInside)

let alertSheet = try! waitUntilTopPresenter(isOfType: UIAlertController.self)
XCTAssertNotNil(alertSheet)
XCTAssertEqual(alertSheet.actions.count, 3)
XCTAssertEqual(alertSheet.actions[0].title, "Copy code")
XCTAssertEqual(alertSheet.actions[1].title, "Save as image")
XCTAssertEqual(alertSheet.actions[2].title, "Cancel")
let alertSheet = try waitUntilTopPresenter(isOfType: UIAlertController.self)

let expectedActionTitles = [
"Copy code",
"Save as image",
"Cancel"
]

XCTAssertEqual(alertSheet.actions.map(\.title), expectedActionTitles)
XCTAssertEqual(alertSheet.actions.count, expectedActionTitles.count)

presentationDelegateExpectation.fulfill()
}
Expand Down
3 changes: 1 addition & 2 deletions Tests/IntegrationTests/Card Tests/CardComponentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,12 @@ class CardComponentTests: XCTestCase {
configuration: configuration
)

setupRootViewController(component.viewController)
presentOnRoot(component.viewController)

let switchView: UISwitch = try XCTUnwrap(component.viewController.view.findView(with: "AdyenCard.CardComponent.storeDetailsItem.switch"))
let securityCodeItemView: FormTextItemView<FormCardSecurityCodeItem> = try XCTUnwrap(component.viewController.view.findView(with: "AdyenCard.CardComponent.securityCodeItem"))

wait(until: switchView, at: \.onTintColor, is: tintColor)

wait(until: securityCodeItemView, at: \.titleLabel.textColor, is: titleColor)

try withoutAnimation {
Expand Down

0 comments on commit 0b3bd49

Please sign in to comment.