-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from strvcom/feat/ci-workflow
[feat]: Add CI workflow to run tests
- Loading branch information
Showing
12 changed files
with
391 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: "Networking CI" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
unit-tests: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.runsOn }} | ||
env: | ||
DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}.app/Contents/Developer" | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: 'iOS 17.2' | ||
destination: 'OS=17.2,name=iPhone 15 Pro' | ||
xcode: 'Xcode_15.2' | ||
runsOn: macos-14 | ||
# - name: 'iOS 16.4' | ||
# destination: 'OS=16.4,name=iPhone 14 Pro' | ||
# xcode: 'Xcode_14.3.1' | ||
# runsOn: macos-13 | ||
- name: 'macOS 13, Xcode 15.2' | ||
destination: 'platform=macOS' | ||
xcode: 'Xcode_15.2' | ||
runsOn: macos-14 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 'Running unit tests on ${{ matrix.name }}' | ||
run: | | ||
set -o pipefail && \ | ||
xcodebuild clean test -resultBundlePath "TestResults-${{ matrix.name }}" -skipPackagePluginValidation -scheme "Networking" -destination "${{ matrix.destination }}" | tee "build-log-${{ matrix.name }}.txt" | xcpretty | ||
- uses: kishikawakatsumi/xcresulttool@v1 | ||
with: | ||
path: 'TestResults-${{ matrix.name }}.xcresult' | ||
title: '${{ matrix.name }} Test Results' | ||
if: success() || failure() | ||
|
||
- name: 'Upload Build Log' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: 'build-log-${{ matrix.name }}' | ||
path: 'build-log-${{ matrix.name }}.txt' | ||
if: success() || failure() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...king/Misc/MockResponseProviderError.swift → ...ng/Misc/StoredResponseProviderError.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// FileDataWriter.swift | ||
// | ||
// | ||
// Created by Jan Kodeš on 24.01.2024. | ||
// | ||
|
||
import Foundation | ||
|
||
/// A protocol defining an interface for writing data to a file. | ||
public protocol FileDataWriting { | ||
/// Writes the given data to the specified URL. | ||
/// | ||
/// - Parameters: | ||
/// - data: The `Data` object that needs to be written to the file. | ||
/// - url: The destination `URL` where the data should be written. | ||
/// - Throws: An error if the data cannot be written to the URL. | ||
func write(_ data: Data, to url: URL) throws | ||
} | ||
|
||
|
||
/// A class that implements data writing functionality. | ||
public class FileDataWriter: FileDataWriting { | ||
public init() {} | ||
|
||
public func write(_ data: Data, to url: URL) throws { | ||
try data.write(to: url) | ||
} | ||
} |
Oops, something went wrong.