From 32edd8ad221ad9f0063c2a9774d495218b58c726 Mon Sep 17 00:00:00 2001 From: Guilherme Oenning Date: Thu, 5 Oct 2023 17:59:14 +0100 Subject: [PATCH] Add GitHub Action + multiplatform tests (#11) --- .github/workflows/ci.yaml | 31 +++++++++++++++++--------- Aptabase.podspec | 2 +- Sources/Aptabase/Aptabase.swift | 2 +- Sources/Aptabase/AptabaseClient.swift | 2 +- Sources/Aptabase/EventDispatcher.swift | 1 - 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b4a5207..ed04109 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,20 +8,29 @@ on: jobs: build: - name: Swift ${{ matrix.swift }} - runs-on: macos-latest + name: ${{ matrix.platform }} on Xcode ${{ matrix.xcode }} + runs-on: macos-13 strategy: matrix: - swift: ["5.6", "5.7", "5.8", "5.9"] + platform: [macOS, iOS, tvOS, watchOS] + xcode: [^14] # ^15 steps: - uses: actions/checkout@v4 - - - uses: swift-actions/setup-swift@v1 + + - name: Xcode Build + uses: mxcl/xcodebuild@v1 with: - swift-version: ${{ matrix.swift }} + xcode: ${{ matrix.xcode }} + platform: ${{ matrix.platform }} + action: build + configuration: debug + scheme: Aptabase - - name: Build - run: swift build - - - name: Run tests - run: swift test \ No newline at end of file + - name: Xcode Test + uses: mxcl/xcodebuild@v1 + with: + xcode: ${{ matrix.xcode }} + platform: ${{ matrix.platform }} + action: test + configuration: debug + scheme: AptabaseTests \ No newline at end of file diff --git a/Aptabase.podspec b/Aptabase.podspec index f6a910c..4300ca5 100644 --- a/Aptabase.podspec +++ b/Aptabase.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Aptabase' - s.version = '0.2.3' + s.version = '0.3.2' s.summary = 'Swift SDK for Aptabase: Open Source, Privacy-First and Simple Analytics for Mobile, Desktop and Web Apps' s.homepage = 'https://aptabase.com' s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/Sources/Aptabase/Aptabase.swift b/Sources/Aptabase/Aptabase.swift index 01a972a..c842c41 100644 --- a/Sources/Aptabase/Aptabase.swift +++ b/Sources/Aptabase/Aptabase.swift @@ -12,7 +12,7 @@ import TVUIKit /// The Aptabase client used to track events. public class Aptabase: NSObject { - private static var sdkVersion = "aptabase-swift@0.3.0"; + private static var sdkVersion = "aptabase-swift@0.3.2"; private var env = EnvironmentInfo.current() private var client: AptabaseClient? diff --git a/Sources/Aptabase/AptabaseClient.swift b/Sources/Aptabase/AptabaseClient.swift index 9a40ce3..d2c1505 100644 --- a/Sources/Aptabase/AptabaseClient.swift +++ b/Sources/Aptabase/AptabaseClient.swift @@ -1,7 +1,7 @@ import Foundation internal class AptabaseClient { - private static let sdkVersion = "aptabase-swift@0.3.0"; + private static let sdkVersion = "aptabase-swift@0.3.2"; // Session expires after 1 hour of inactivity private static let sessionTimeout: TimeInterval = 1 * 60 * 60 diff --git a/Sources/Aptabase/EventDispatcher.swift b/Sources/Aptabase/EventDispatcher.swift index 98e5087..c418fa2 100644 --- a/Sources/Aptabase/EventDispatcher.swift +++ b/Sources/Aptabase/EventDispatcher.swift @@ -24,7 +24,6 @@ protocol URLSessionProtocol { extension URLSession: URLSessionProtocol {} - public class EventDispatcher { private var events = ConcurrentQueue() private let MAX_BATCH_SIZE = 25