From 4818a54e655e0959bac2d7094c7c75d23825807a Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Mon, 28 Aug 2023 16:44:06 +0100 Subject: [PATCH] ci(dagger): use the new Sync function --- internal/build/stages.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/internal/build/stages.go b/internal/build/stages.go index 9ca029b..7dc3ce1 100644 --- a/internal/build/stages.go +++ b/internal/build/stages.go @@ -32,16 +32,15 @@ func test(ctx context.Context, client *dagger.Client, projectRoot string, cache containerWorkspace := "/workspace" containerWorkdir := containerWorkspace + "/internal/build" - runner := client.Container(). + _, err := client.Container(). From(image). WithMountedDirectory(containerWorkspace, client.Host().Directory(projectRoot)). WithWorkdir(containerWorkdir). WithEnvVariable("GO_TEST_VERBOSE", "1"). WithEnvVariable("GO_TEST_COVER", "1"). WithExec([]string{"go", "run", "magefiles/main.go", "-v", "test"}). - WithMountedCache("/go/pkg/mod", cache) - - _, err := runner.Stdout(ctx) + WithMountedCache("/go/pkg/mod", cache). + Sync(ctx) if err != nil { return fmt.Errorf("error running the test stage; %w", err) } @@ -55,14 +54,13 @@ func lint(ctx context.Context, client *dagger.Client, projectRoot string, cache containerWorkspace := "/workspace" containerWorkdir := containerWorkspace + "/internal/build" - runner := client.Container(). + _, err := client.Container(). From(image). WithMountedDirectory(containerWorkspace, client.Host().Directory(projectRoot)). WithWorkdir(containerWorkdir). WithExec([]string{"go", "run", "magefiles/main.go", "-v", "lint"}). - WithMountedCache("/go/pkg/mod", cache) - - _, err := runner.Stdout(ctx) + WithMountedCache("/go/pkg/mod", cache). + Sync(ctx) if err != nil { return fmt.Errorf("error running the lint stage; %w", err) }