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

Optimize the processing of CI/CD #63

Merged
merged 2 commits into from
Nov 9, 2023
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:assemble
run: ./gradlew :sqllin-driver:assemble -PonCICD

- name: Run sqllin-driver macOS X64 Tests
run: ./test_driver_macos.sh
Expand All @@ -55,7 +55,7 @@ jobs:
run: ./test_driver_jvm.sh

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble
run: ./gradlew :sqllin-dsl:assemble -PonCICD

- name: Run sqllin-dsl macOS X64 Tests
run: ./test_dsl_macos.sh
Expand Down Expand Up @@ -203,7 +203,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:assemble
run: ./gradlew :sqllin-driver:assemble -PonCICD

- name: Run sqllin-driver Linux X64 Tests
run: ./test_driver_linux.sh
Expand All @@ -215,7 +215,7 @@ jobs:
run: ./gradlew :sqllin-processor:assemble

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble
run: ./gradlew :sqllin-dsl:assemble -PonCICD

- name: Run sqllin-dsl Linux X64 Tests
run: ./test_dsl_linux.sh
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:assemble
run: ./gradlew :sqllin-driver:assemble -PonCICD

- name: Run sqllin-driver macOS X64 Tests
run: ./test_driver_macos.sh
Expand All @@ -50,7 +50,7 @@ jobs:
run: ./test_driver_jvm.sh

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble
run: ./gradlew :sqllin-dsl:assemble -PonCICD

- name: Run sqllin-dsl macOS X64 Tests
run: ./test_dsl_macos.sh
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
if: always()

- name: Publish to MavenCentral
run: ./publish_apple_android.sh
run: ./publish_apple_android_jvm.sh

build-on-windows:
runs-on: windows-latest
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }}

- name: Build sqllin-driver
run: ./gradlew :sqllin-driver:assemble
run: ./gradlew :sqllin-driver:assemble -PonCICD

- name: Run sqllin-driver Linux X64 Tests
run: ./test_driver_linux.sh
Expand All @@ -216,7 +216,7 @@ jobs:
run: ./gradlew :sqllin-processor:assemble

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble
run: ./gradlew :sqllin-dsl:assemble -PonCICD

- name: Run sqllin-dsl Linux X64 Tests
run: ./test_dsl_linux.sh
Expand Down
4 changes: 2 additions & 2 deletions publish_apple_android.sh → publish_apple_android_jvm.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Publish artifacts on macOS env
./gradlew :sqllin-driver:publishAllPublicationsToMavenRepository
./gradlew :sqllin-dsl:publishAllPublicationsToMavenRepository
./gradlew :sqllin-driver:publishAllPublicationsToMavenRepository -PonCICD
./gradlew :sqllin-dsl:publishAllPublicationsToMavenRepository -PonCICD
4 changes: 3 additions & 1 deletion publish_linux_processor.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Publish artifacts on Linux env
./gradlew :sqllin-driver:publishLinuxX64PublicationToMavenRepository
./gradlew :sqllin-driver:publishLinuxArm64PublicationToMavenRepository
./gradlew :sqllin-processor:publishProcessorPublicationToMavenRepository
./gradlew :sqllin-dsl:publishLinuxX64PublicationToMavenRepository
./gradlew :sqllin-dsl:publishLinuxX64PublicationToMavenRepository
./gradlew :sqllin-dsl:publishLinuxArm64PublicationToMavenRepository
2 changes: 1 addition & 1 deletion sqllin-driver/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

最初我们需要一个多平台可用的低阶 Kotlin API 来调用 SQLite。因为我们认为 _sqllin-dsl_ 应该是平台无关的。
所以我们需要 _sqllin-driver_ ,并且 _sqllin-dsl_ 要基于它。我们的目标是编写 Kotlin Multiplatform common
source set 可用的通用的 API,并且它们在不同的平台有不同的实现。
source set 可用的通用 API,并且它们在不同的平台有不同的实现。

在 Android 上,并没有太多的方法可供我们选择。如果我们使用 Android Framework SQLite JAVA
API,事情将会变得非常简单,但是缺点是很多 SQLite 参数不能再 Android P 以下版本的系统上生效。如果我们自己编写
Expand Down
17 changes: 14 additions & 3 deletions sqllin-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,21 @@ kotlin {
}
}
}
}

tasks.findByName("publishLinuxX64PublicationToMavenRepository")?.enabled = HostManager.hostIsLinux
tasks.findByName("publishLinuxArm64PublicationToMavenRepository")?.enabled = HostManager.hostIsLinux
tasks.findByName("publishMingwX64PublicationToMavenRepository")?.enabled = HostManager.hostIsMingw
gradle.taskGraph.whenReady {
if (!project.hasProperty("onCICD"))
return@whenReady
tasks.forEach {
when {
it.name.contains("linux", true) -> {
it.enabled = HostManager.hostIsLinux
}
it.name.contains("mingw", true) -> {
it.enabled = HostManager.hostIsMingw
}
}
}
}

android {
Expand Down
17 changes: 14 additions & 3 deletions sqllin-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,21 @@ kotlin {
}
}
}
}

tasks.findByName("publishLinuxX64PublicationToMavenRepository")?.enabled = HostManager.hostIsLinux
tasks.findByName("publishLinuxArm64PublicationToMavenRepository")?.enabled = HostManager.hostIsLinux
tasks.findByName("publishMingwX64PublicationToMavenRepository")?.enabled = HostManager.hostIsMingw
gradle.taskGraph.whenReady {
if (!project.hasProperty("onCICD"))
return@whenReady
tasks.forEach {
when {
it.name.contains("linux", true) -> {
it.enabled = HostManager.hostIsLinux
}
it.name.contains("mingw", true) -> {
it.enabled = HostManager.hostIsMingw
}
}
}
}

android {
Expand Down
Loading