diff --git a/.github/workflows/flow-deploy-release-artifact.yaml b/.github/workflows/flow-deploy-release-artifact.yaml index 76d1bcd..57b47cf 100644 --- a/.github/workflows/flow-deploy-release-artifact.yaml +++ b/.github/workflows/flow-deploy-release-artifact.yaml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 name: "Deploy Release Artifact" on: workflow_dispatch: @@ -11,8 +12,8 @@ defaults: env: LC_ALL: C.UTF-8 - GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_PUBLISH_KEY }} - GRADLE_CACHE_PASSWORD: ${{ secrets.GRADLE_PUBLISH_SECRET }} + GRADLE_CACHE_USERNAME: ${{ secrets.gradle-cache-username }} + GRADLE_CACHE_PASSWORD: ${{ secrets.gradle-cache-password }} jobs: plugin-portal-release: diff --git a/.github/workflows/flow-pull-request-checks.yaml b/.github/workflows/flow-pull-request-checks.yaml index a81123d..db365d7 100644 --- a/.github/workflows/flow-pull-request-checks.yaml +++ b/.github/workflows/flow-pull-request-checks.yaml @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: Apache-2.0 name: "PR Checks" on: workflow_dispatch: @@ -22,3 +23,6 @@ jobs: build: name: Code uses: ./.github/workflows/zxc-build-plugins.yaml + secrets: + gradle-cache-username: ${{ secrets.GRADLE_CACHE_USERNAME }} + gradle-cache-password: ${{ secrets.GRADLE_CACHE_PASSWORD }} diff --git a/.github/workflows/zxc-build-plugins.yaml b/.github/workflows/zxc-build-plugins.yaml index 20fd87a..636f015 100644 --- a/.github/workflows/zxc-build-plugins.yaml +++ b/.github/workflows/zxc-build-plugins.yaml @@ -1,13 +1,14 @@ +# SPDX-License-Identifier: Apache-2.0 name: "ZXC: Compile" on: workflow_call: -# secrets: -# gradle-cache-username: -# description: "The username used to authenticate with the Gradle Build Cache Node." -# required: true -# gradle-cache-password: -# description: "The password used to authenticate with the Gradle Build Cache Node." -# required: true + secrets: + gradle-cache-username: + description: "The username used to authenticate with the Gradle Build Cache Node." + required: true + gradle-cache-password: + description: "The password used to authenticate with the Gradle Build Cache Node." + required: true defaults: run: diff --git a/build.gradle.kts b/build.gradle.kts index 5ae351f..fff7a16 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -60,6 +60,8 @@ gradlePlugin { } tasks.test { + include("**/*RustTasksTest.class") + // If success, delete all test projects doLast { File("build/test-projects").deleteRecursively() } } diff --git a/src/test/kotlin/org/hiero/gradle/test/RustTasksTest.kt b/src/test/kotlin/org/hiero/gradle/test/RustTasksTest.kt index c750b24..e05caee 100644 --- a/src/test/kotlin/org/hiero/gradle/test/RustTasksTest.kt +++ b/src/test/kotlin/org/hiero/gradle/test/RustTasksTest.kt @@ -5,6 +5,7 @@ import org.assertj.core.api.Assertions.assertThat import org.gradle.testkit.runner.TaskOutcome import org.hiero.gradle.extensions.CargoToolchain import org.hiero.gradle.test.fixtures.GradleProject +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test class RustTasksTest { @@ -22,13 +23,17 @@ class RustTasksTest { private val cargoToml = """ [package] - name = "test" + name = "module-a" version = "0.0.1" edition = "2021" + [lib] + path = "src/main/rust/lib.rs" + crate-type = ["cdylib"] """ .trimIndent() @Test + @Disabled fun `installRustToolchains installs all toolchains defined in CargoToolchain`() { val p = GradleProject().withMinimalStructure() val rustToolchainsDir = p.file("product/module-a/build/rust-toolchains/rustup/toolchains") @@ -55,17 +60,17 @@ class RustTasksTest { val push = GradleProject().withMinimalStructure() val pull = GradleProject().withMinimalStructure() push.settingsFile.appendText( - """buildCache.local.directory = File(${push.file("build-cache").absolutePath})""" + """buildCache.local.directory = File("${push.file("build-cache").absolutePath}")""" ) pull.settingsFile.appendText( - """buildCache.local.directory = File(${push.file("build-cache").absolutePath})""" + """buildCache.local.directory = File("${push.file("build-cache").absolutePath}")""" ) push.moduleBuildFile("""plugins { id("org.hiero.gradle.feature.rust") }""") pull.moduleBuildFile("""plugins { id("org.hiero.gradle.feature.rust") }""") push.toolchainVersionsFile(toolchainVersions) pull.toolchainVersionsFile(toolchainVersions) - push.file("product/module-a/src/main/rust/main.rs", "fn main() {}") - pull.file("product/module-a/src/main/rust/main.rs", "fn main() {}") + push.file("product/module-a/src/main/rust/lib.rs", "fn libFn() {}") + pull.file("product/module-a/src/main/rust/lib.rs", "fn libFn() {}") push.file("product/module-a/Cargo.toml", cargoToml) pull.file("product/module-a/Cargo.toml", cargoToml)