Skip to content

Commit

Permalink
Merge pull request #4 from kaszabimre/add-github-workflows
Browse files Browse the repository at this point in the history
Add GitHub workflows
  • Loading branch information
kaszabimre authored Oct 4, 2024
2 parents 2a57704 + ebf59f5 commit 4f0c5da
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 3 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: PR job

on:
workflow_dispatch:
push:
branches:
- main
- development
pull_request:
paths-ignore:
- "**.md"
- "*.png"
- docs

jobs:
pre-conditions:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/[email protected]
with:
distribution: corretto
java-version: 18

- name: detekt
run: ./gradlew detekt --stacktrace

- name: GitHub Action for SwiftLint (Only files changed in the PR)
uses: norio-nomura/[email protected]
env:
WORKING_DIRECTORY: ./iosApp

build-android:
needs: pre-conditions
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/[email protected]
with:
distribution: corretto
java-version: 18

- name: Build
run: ./gradlew build --stacktrace

build-ios:
needs: pre-conditions
runs-on: macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/[email protected]
with:
distribution: corretto
java-version: 18

- name: Grant execute permission for gradlew
run: chmod +x ./gradlew

- name: Select Xcode version
run: |
XCODE_VERSION="15.0"
sudo xcode-select -s "/Applications/Xcode_${XCODE_VERSION}.app"
- name: Build
run: |
cd iosApp
rm -f iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
xcodebuild -resolvePackageDependencies -project iosApp.xcodeproj
xcodebuild build-for-testing \
-scheme "EAPlayers" \
-project iosApp.xcodeproj \
-destination 'platform=iOS Simulator,name=iPhone 14,OS=16.4' \
-allowProvisioningUpdates
2 changes: 1 addition & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ kotlin {
implementation(libs.ktor.client.core)
implementation(libs.koin.core)
implementation(libs.koin.compose.multiplatform)
implementation("co.touchlab:stately-common:2.0.5")
implementation(libs.stately.common)

implementation(libs.coil.compose.core)
implementation(libs.coil.compose)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fun PlayerListScreen(
) {
val uiState by viewModel.uiState.collectAsStateInLifecycle()

var searchQuery by remember { mutableStateOf("") }
var searchQuery by remember { mutableStateOf(viewModel.uiState.value.textFieldValue) }

LaunchedEffect(searchQuery) {
viewModel.refreshPlayers(searchQuery)
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ koinAndroid = "3.5.0"
koinAndroidCompose = "3.5.0"
koinCompose = "1.1.1-RC1"

detekt = "1.23.3"
detekt = "1.23.7"
composeMaterial = "1.4.0"
statelyCommon = "2.0.5"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand Down Expand Up @@ -70,6 +71,7 @@ koin-ktor = { module = "io.insert-koin:koin-ktor", version.ref = "koin" }
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }
detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version.ref = "detekt" }
androidx-compose-material = { group = "androidx.wear.compose", name = "compose-material", version.ref = "composeMaterial" }
stately-common = { module = "co.touchlab:stately-common", version.ref = "statelyCommon" }

[plugins]
kotlin-parcelize = { id = "kotlin-parcelize", version = "kotlin" }
Expand Down

0 comments on commit 4f0c5da

Please sign in to comment.