Skip to content

Commit

Permalink
Merge pull request DroidKaigi#455 from DroidKaigi/feature/ios_test_ac…
Browse files Browse the repository at this point in the history
…tion

iOS test action
  • Loading branch information
ry-itto authored Aug 16, 2024
2 parents e7cd75e + 8c5ad31 commit 2f31ed1
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: iOS Build
name: iOS Build and Test

on:
push:
branches: [ "main" ]
pull_request:

concurrency:
group: ios-build-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-ios:
build-test-ios:
runs-on: macos-latest

steps:
Expand All @@ -20,3 +20,5 @@ jobs:
run: echo "arch=arm64" >> local.properties
- run: make build-app-debug
working-directory: app-ios
- run: make test-app-debug
working-directory: app-ios
36 changes: 25 additions & 11 deletions app-ios/App/App.xctestplan
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
}
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:..",
"identifier" : "TimetableDetailFeatureTests",
"name" : "TimetableDetailFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
Expand All @@ -27,43 +34,50 @@
{
"target" : {
"containerPath" : "container:..",
"identifier" : "AppTests",
"name" : "AppTests"
"identifier" : "SponsorFeatureTests",
"name" : "SponsorFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "TimetableDetailFeatureTests",
"name" : "TimetableDetailFeatureTests"
"identifier" : "ContributorFeatureTests",
"name" : "ContributorFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:",
"containerPath" : "container:..",
"identifier" : "StaffFeatureTests",
"name" : "StaffFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "FavoriteFeatureTests",
"name" : "FavoriteFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "ContributorFeatureTests",
"name" : "ContributorFeatureTests"
"identifier" : "EventMapFeatureTests",
"name" : "EventMapFeatureTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "SponsorFeatureTests",
"name" : "SponsorFeatureTests"
"identifier" : "TimetableTests",
"name" : "TimetableTests"
}
},
{
"target" : {
"containerPath" : "container:..",
"identifier" : "StaffFeatureTests",
"name" : "StaffFeatureTests"
"identifier" : "AppTests",
"name" : "AppTests"
}
}
],
Expand Down
11 changes: 11 additions & 0 deletions app-ios/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ build-app-debug: build-kmp-module
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5" \
clean build | xcbeautify

.PHONY: test-app-debug
test-app-debug:
set -o pipefail && \
xcodebuild test -project $(PROJECT_FILE) \
-scheme $(SCHEME_NAME_APP) \
-configuration Debug \
-skipPackagePluginValidation \
-skipMacroValidation \
-destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=17.5" \
| xcbeautify

.PHONY: bootstrap
bootstrap:
make setup && \
Expand Down
1 change: 1 addition & 0 deletions app-ios/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ let package = Package(
.kmpClient,
.theme,
.model,
.commonComponents,
]
),
.testTarget(
Expand Down
11 changes: 1 addition & 10 deletions app-ios/Tests/TimetableTests/TimetableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ import XCTest
import ComposableArchitecture
@testable import TimetableFeature

final class TimetableTests: XCTestCase {
@MainActor func testExample() async throws {
let store = TestStore(initialState: TimetableReducer.State()) {
TimetableReducer()
}
await store.send(.onAppear) {
$0.timetableItems = SampleData().workdayResults
}
}
}
final class TimetableTests: XCTestCase {}

0 comments on commit 2f31ed1

Please sign in to comment.