Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub workflows #4

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading