Skip to content

Commit

Permalink
DTPOMERSER-1389 Update OS to runner mac-15, install swiftlinter and a…
Browse files Browse the repository at this point in the history
…ddress lint issues (#151)
  • Loading branch information
grmeyer-hw-dev authored Jan 30, 2025
1 parent b3f8408 commit 68b1894
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-12
xcode_version: 14.2
- os: macos-15
xcode_version: 16.2
fastlane_task: unit_tests

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -47,8 +47,12 @@ jobs:
- name: Run ${{ matrix.task_title }}
run: fastlane ${{ matrix.fastlane_task }}

- name: Lint validation
- name: Install Lint
run:
brew install swiftlint

- name: Lint validation
run:
swiftlint lint --strict --reporter json

- name: Code Coverage [Build report]
Expand All @@ -74,4 +78,4 @@ jobs:
- name: Post to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions Tests/AnyCodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ class AnyCodableTests: XCTestCase {

// Then
XCTAssertNotNil(jsonBody)
let jsonBodyString = String(decoding: jsonBody, as: UTF8.self)
XCTAssertTrue(((jsonBodyString.contains("USD"))))
let jsonBodyString = String(bytes: jsonBody, encoding: .utf8)
XCTAssertNotNil(jsonBodyString)
XCTAssertTrue(((jsonBodyString!.contains("USD"))))
}

func testDecode() {
Expand Down
4 changes: 2 additions & 2 deletions Tests/Helper/AuthenticationProviderMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class AuthenticationProviderMock: HyperwalletAuthenticationTokenProvider {
error = nil
}

func retrieveAuthenticationToken(completionHandler authenticationTokenHandler: @escaping
AuthenticationProviderMock.CompletionHandler) {
func retrieveAuthenticationToken(
completionHandler authenticationTokenHandler: @escaping AuthenticationProviderMock.CompletionHandler) {
hasRequestedClientToken = true
authenticationTokenHandler(authorizationData, error)
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/TransactionTypeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ class TransactionTypeTests: XCTestCase {
if httpMethod == .get {
XCTAssertNil(urlRequest.httpBody, "The HTTP body should be nil")
} else {
let httpBody = String(decoding: urlRequest.httpBody!, as: UTF8.self)
let httpBody = String(bytes: urlRequest.httpBody!, encoding: .utf8)
let payloadData = try JSONEncoder().encode(payload)
let payloadString = String(decoding: payloadData, as: UTF8.self)
let payloadString = String(bytes: payloadData, encoding: .utf8)
XCTAssertEqual(httpBody, payloadString, "The HTTP body should be equals to payload")
}

Expand Down Expand Up @@ -165,7 +165,7 @@ class TransactionTypeTests: XCTestCase {
if httpMethod == .get {
XCTAssertNil(urlRequest.httpBody, "The HTTP body should be nil")
} else {
let query = String(decoding: urlRequest.httpBody!, as: UTF8.self)
let query = String(bytes: urlRequest.httpBody!, encoding: .utf8)
let payloadString = payload.toGraphQl(userToken: configuration.userToken)
XCTAssertEqual(query, payloadString, "The HTTP body should be equals to payload")
}
Expand Down

0 comments on commit 68b1894

Please sign in to comment.