ci(dagger): use the new Sync function
This commit is contained in:
parent
3594c71773
commit
4818a54e65
1 changed files with 6 additions and 8 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue