Skip to content

Commit

Permalink
Optimize the CI/CD processing
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoyuang committed Nov 9, 2023
1 parent e6664ec commit 2d2e819
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 16 deletions.
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
8 changes: 4 additions & 4 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 @@ -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: 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

0 comments on commit 2d2e819

Please sign in to comment.