Skip to content

Commit

Permalink
fixing tests and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Oct 22, 2024
1 parent e2a50d5 commit bc42502
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 37 deletions.
37 changes: 13 additions & 24 deletions .github/workflows/FelinePineLogging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ jobs:
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
runs-on: [ubuntu-20.04, ubuntu-22.04]
swift-version: [5.8.1, 5.9, "5.10", "6.0.1"]
runs-on: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
swift-version: [5.8.1, 5.9, "5.10.1", "6.0.1"]
exclude:
- runs-on: ubuntu-24.04
swift-version: 5.9
- runs-on: ubuntu-24.04
swift-version: 5.8.1
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
Expand Down Expand Up @@ -76,12 +81,6 @@ jobs:
strategy:
matrix:
include:
- runs-on: macos-13
xcode: "/Applications/Xcode_14.3.1.app"
iOSVersion: "16.4"
watchOSVersion: "9.4"
watchName: "Apple Watch Series 5 (40mm)"
iPhoneName: "iPhone 14"
- runs-on: macos-13
xcode: "/Applications/Xcode_15.0.1.app"
iOSVersion: "17.0.1"
Expand All @@ -101,11 +100,11 @@ jobs:
watchName: "Apple Watch Series 9 (45mm)"
iPhoneName: "iPhone 15 Pro"
- runs-on: macos-15
xcode: "/Applications/Xcode_16.1.app"
iOSVersion: "18.0"
watchOSVersion: "11.0"
watchName: "Apple Watch Series 10 (42mm)"
iPhoneName: "iPhone 16"
xcode: "/Applications/Xcode_16.1.app"
iOSVersion: "18.1"
watchOSVersion: "11.1"
watchName: "Apple Watch Series 10 (46mm)"
iPhoneName: "iPhone 16 Pro"
steps:
- uses: actions/checkout@v4
- name: Cache swift package modules
Expand Down Expand Up @@ -145,7 +144,7 @@ jobs:
- name: Build
run: swift build
- name: Run Swift Package tests
run: swift test -v --enable-code-coverage
run: swift test -v --enable-code-coverage
- uses: sersoft-gmbh/swift-coverage-action@v4
id: coverage-files-spm
with:
Expand All @@ -161,16 +160,6 @@ jobs:
- name: Lint
run: ./scripts/lint.sh
if: ${{ github.event_name == 'pull_request' && ( github.base_ref == 'main' || endsWith( github.ref_name , 'Prep') ) && matrix.xcode == '/Applications/Xcode_16.1.app' }}
- name: Dump PIF
if: startsWith(matrix.xcode,'/Applications/Xcode_14')
run: |
swift package dump-pif > /dev/null
MAX_ATTEMPT=3
ATTEMPT=0
while [ -z $SUCCESS ] && [ "$ATTEMPT" -le "$MAX_ATTEMPT" ]; do
xcodebuild clean -scheme FelinePine -destination 'generic/platform=iOS' | grep -q "CLEAN SUCCEEDED" && SUCCESS=true
ATTEMPT=$(($ATTEMPT+1))
done
- name: Run iOS target tests
run: xcodebuild test -scheme FelinePine -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.iPhoneName }},OS=${{ matrix.iOSVersion }}' -enableCodeCoverage YES build test
- uses: sersoft-gmbh/swift-coverage-action@v4
Expand Down
2 changes: 1 addition & 1 deletion Packages/FelinePine/.swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
--disable wrapMultilineStatementBraces, redundantInternal
--extensionacl on-declarations
--decimalgrouping 3,4
--exclude .build, DerivedData, Sample
--exclude .build, DerivedData, Sample, Packages
1 change: 1 addition & 0 deletions Packages/FelinePine/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ identifier_name:
excluded:
- DerivedData
- .build
- Packages
indentation_width:
indentation_width: 2
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ private class LoggingSystemRepository: @unchecked Sendable {

// swiftlint:enable strict_fileprivate

extension LoggingSystem {
// swiftlint:disable:next missing_docs
public static var identifier: String {
String(reflecting: Self.self)
}

/// By default, this is `Bundle.main.bundleIdentifier`.
public static var subsystem: String {
identifier
}
}
//extension LoggingSystem {
// // swiftlint:disable:next missing_docs
// public static var identifier: String {
// String(reflecting: Self.self)
// }
//
// /// By default, this is `Bundle.main.bundleIdentifier`.
// public static var subsystem: String {
// identifier
// }
//}

extension LoggingSystem where Category: CaseIterable {
private static var loggers: [Category: Logging.Logger] {
Expand Down
3 changes: 2 additions & 1 deletion Tests/FelinePineLoggingTests/Mocks/MockSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
// OTHER DEALINGS IN THE SOFTWARE.
//

@testable import FelinePineLogging
@testable public import FelinePineLogging
import XCTest
import FelinePine

internal struct MockSystem: LoggingSystem {
internal enum Category: String, CaseIterable {
Expand Down
1 change: 1 addition & 0 deletions Tests/FelinePineLoggingTests/Mocks/MockType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

@testable import FelinePineLogging
import XCTest
import FelinePine

internal struct MockType: FelinePineProtocol {
internal typealias LoggingSystemType = MockSystem
Expand Down

0 comments on commit bc42502

Please sign in to comment.