mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
ci: update test on push src path
This commit is contained in:
+4
-4
@@ -25,17 +25,17 @@ func main() {
|
|||||||
// at /src in the container
|
// at /src in the container
|
||||||
source := client.Container().
|
source := client.Container().
|
||||||
From("golang:1.23").
|
From("golang:1.23").
|
||||||
WithDirectory("/src", client.Host().Directory(".", dagger.HostDirectoryOpts{
|
WithDirectory("/src_d", client.Host().Directory(".", dagger.HostDirectoryOpts{
|
||||||
Exclude: []string{"build/"},
|
Exclude: []string{"build/"},
|
||||||
})).WithMountedCache("/src/dagger_dep_cache/go_dep", goCache)
|
})).WithMountedCache("/src_d/dagger_dep_cache/go_dep", goCache)
|
||||||
|
|
||||||
// set the working directory in the container
|
// set the working directory in the container
|
||||||
// install application dependencies
|
// install application dependencies
|
||||||
runner := source.WithWorkdir("/src/src_code/go_src/").
|
runner := source.WithWorkdir("/src_d/src").
|
||||||
WithExec([]string{"go", "mod", "tidy"}).WithEnvVariable("CI", "true")
|
WithExec([]string{"go", "mod", "tidy"}).WithEnvVariable("CI", "true")
|
||||||
|
|
||||||
// run application tests
|
// run application tests
|
||||||
out, err := runner.WithWorkdir("/src/src_code/go_src/").WithExec([]string{"go", "test", "./..."}).
|
out, err := runner.WithWorkdir("/src_d/src").WithExec([]string{"go", "test", "./..."}).
|
||||||
Stderr(ctx)
|
Stderr(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user