From a77b185d4e6f71eea7bdf6c515d6cd01ed71e64c Mon Sep 17 00:00:00 2001 From: Marcel Kesselring <2410681-Ingwersaft@users.noreply.gitlab.com> Date: Mon, 7 Aug 2023 12:57:37 +0200 Subject: [PATCH] chore(CI): checkout all history --- .github/workflows/build.yaml | 3 +++ .github/workflows/publish.yaml | 5 ++++- .../liftric/octopusdeploy/task/FirstCommitHashTaskTest.kt | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6addc77..f1773ad 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,6 +14,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: +# needed for FirstCommitHashTaskTest + fetch-depth: 0 - name: Cache uses: gradle/gradle-build-action@v2 - name: Build diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 443703a..573bdd1 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,11 +14,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + with: + # needed for FirstCommitHashTaskTest + fetch-depth: 0 - name: Cache uses: gradle/gradle-build-action@v2 - name: Build run: ./gradlew build - name: Validate - run: ./gradlew check validatePlugins --continue + run: ./gradlew validatePlugins --continue - name: Publish run: ./gradlew publishPlugins diff --git a/src/test/kotlin/com/liftric/octopusdeploy/task/FirstCommitHashTaskTest.kt b/src/test/kotlin/com/liftric/octopusdeploy/task/FirstCommitHashTaskTest.kt index a0bc53b..a859fca 100644 --- a/src/test/kotlin/com/liftric/octopusdeploy/task/FirstCommitHashTaskTest.kt +++ b/src/test/kotlin/com/liftric/octopusdeploy/task/FirstCommitHashTaskTest.kt @@ -28,6 +28,7 @@ class FirstCommitHashTaskTest { assertEquals(TaskOutcome.SUCCESS, result.task(":firstCommitHash")?.outcome) File("${testProjectDir.root.absolutePath}/build/$extensionName/firstCommitHash").apply { assertTrue(exists()) + // this is the first commit hash of the octopus-deploy-plugin git repo itself assertEquals("9c82501b25fd6c03bd6f3074739496b498cf3938", readText()) } }