From c15b95375f1278e62d27cb73c0e90238bb6c79bc Mon Sep 17 00:00:00 2001 From: lovestaco Date: Thu, 20 Jul 2023 19:22:31 +0530 Subject: [PATCH] yaml --- .github/workflows/testapp.yml | 6 +++++- tests/env_command_test.go | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testapp.yml b/.github/workflows/testapp.yml index 80ea87f5..4f9b30fe 100644 --- a/.github/workflows/testapp.yml +++ b/.github/workflows/testapp.yml @@ -20,6 +20,10 @@ jobs: - name: Show Binary Directory run: echo "$PWD" - name: Test with the Go CLI - run: go test -v ./tests/ + run: | + go mod tidy + go build -o build/l2 -ldflags "-X main.version=`git tag --sort=-version:refname | head -n 1`" l2.go + go test -v ./tests/ + - name: Deploy hexmos doc run: curl -X POST --fail -F token=${{ secrets.TRIGGER_TOKEN }} -F ref=main https://git.apps.hexmos.com/api/v4/projects/85/trigger/pipeline \ No newline at end of file diff --git a/tests/env_command_test.go b/tests/env_command_test.go index dea99075..59c2d933 100644 --- a/tests/env_command_test.go +++ b/tests/env_command_test.go @@ -16,12 +16,14 @@ type EnvData struct { } func runL2CommandAndParseJSON(t *testing.T, cmdArgs ...string) { - // Store the current working directory + + // Store the current working directory originalPath, err := os.Getwd() if err != nil { fmt.Println("Error getting the current working directory:", err) return } + listFilesInDir(originalPath) // Change the current working directory to lama2Path l2BinPath := "/home/runner/work/Lama2/Lama2" @@ -33,7 +35,7 @@ func runL2CommandAndParseJSON(t *testing.T, cmdArgs ...string) { listFilesInDir(l2BinPath) - cmd := exec.Command("./l2", cmdArgs...) // Use "./l2" as the executable name + cmd := exec.Command("./../build/l2", cmdArgs...) // Use "./l2" as the executable name var stdout bytes.Buffer cmd.Stdout = &stdout