Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print test output to screen #254

Merged
merged 2 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/publish-and-sign/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 export --path=./testResults
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
Expand Down Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,17 @@ 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").
WithMountedCache("/go/build-cache", dag.CacheVolume("go-build-"+GO_VERSION)).
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
Expand Down