From f11e148cd16bb97be7127ec1523f4a0f151e186c Mon Sep 17 00:00:00 2001 From: Vadim Bauer Date: Thu, 14 Nov 2024 11:05:04 -0700 Subject: [PATCH 1/2] print test output to screen Signed-off-by: Vadim Bauer --- .github/workflows/default.yaml | 2 +- dagger/main.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index 59800436..521034e2 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -49,7 +49,7 @@ jobs: with: version: ${{ steps.dagger_version.outputs.version }} verb: call - args: test export --path=./testResults + args: test - name: Build Binary uses: dagger/dagger-for-github@v6 diff --git a/dagger/main.go b/dagger/main.go index 762f1344..1035123f 100644 --- a/dagger/main.go +++ b/dagger/main.go @@ -225,8 +225,8 @@ func (m *HarborCli) RunDoc(ctx context.Context) *dagger.Directory { } // Test Executes Go tests and returns the directory containing the test results -func (m *HarborCli) Test(ctx context.Context) *dagger.Directory { - return dag.Container(). +func (m *HarborCli) Test(ctx context.Context) (string, error) { + test := dag.Container(). From("golang:"+GO_VERSION+"-alpine"). WithMountedCache("/go/pkg/mod", dag.CacheVolume("go-mod-"+GO_VERSION)). WithEnvVariable("GOMODCACHE", "/go/pkg/mod"). @@ -234,8 +234,8 @@ func (m *HarborCli) Test(ctx context.Context) *dagger.Directory { WithEnvVariable("GOCACHE", "/go/build-cache"). WithMountedDirectory("/src", m.Source). WithWorkdir("/src"). - WithExec([]string{"go", "test", "./..."}). - Directory("/src") + WithExec([]string{"go", "test", "-v", "./..."}) + return test.Stdout(ctx) } // Parse the platform string into os and arch From 2016059e7ed1133cc87f3a7261b8b3f01a2c8f68 Mon Sep 17 00:00:00 2001 From: Vadim Bauer Date: Thu, 14 Nov 2024 11:27:46 -0700 Subject: [PATCH 2/2] update to dagger/dagger-for-github@v7 Signed-off-by: Vadim Bauer --- .github/actions/publish-and-sign/action.yaml | 2 +- .github/workflows/default.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/actions/publish-and-sign/action.yaml b/.github/actions/publish-and-sign/action.yaml index 6422743d..73a613fd 100644 --- a/.github/actions/publish-and-sign/action.yaml +++ b/.github/actions/publish-and-sign/action.yaml @@ -34,7 +34,7 @@ runs: run: cosign env - name: Publish and Sign Snapshot Image - uses: dagger/dagger-for-github@v6 + uses: dagger/dagger-for-github@v7 env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }} REGISTRY_ADDRESS: ${{ inputs.REGISTRY_ADDRESS }} diff --git a/.github/workflows/default.yaml b/.github/workflows/default.yaml index 521034e2..c1953237 100644 --- a/.github/workflows/default.yaml +++ b/.github/workflows/default.yaml @@ -23,7 +23,7 @@ jobs: uses: sagikazarmark/dagger-version-action@v0.0.1 - name: Run Dagger golangci-lint - uses: dagger/dagger-for-github@v6 + uses: dagger/dagger-for-github@v7 with: version: ${{ steps.dagger_version.outputs.version }} verb: call @@ -45,14 +45,14 @@ jobs: fetch-depth: 0 - name: Run Tests - uses: dagger/dagger-for-github@v6 + uses: dagger/dagger-for-github@v7 with: version: ${{ steps.dagger_version.outputs.version }} verb: call args: test - name: Build Binary - uses: dagger/dagger-for-github@v6 + uses: dagger/dagger-for-github@v7 with: version: ${{ steps.dagger_version.outputs.version }} verb: call @@ -99,7 +99,7 @@ jobs: with: fetch-depth: 0 - name: Create Release - uses: dagger/dagger-for-github@v6 + uses: dagger/dagger-for-github@v7 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: