diff --git a/test/dagger/hof.go b/test/dagger/hof.go index 6a6de5be..58e4e368 100644 --- a/test/dagger/hof.go +++ b/test/dagger/hof.go @@ -21,11 +21,11 @@ func (R *Runtime) GolangImage(platform string) (*dagger.Container) { From(goVer) // setup mod cache - modCache := R.Client.CacheVolume("gomod-" + platform) + modCache := R.Client.CacheVolume(fmt.Sprintf("gomod-%s-%s", goVer, platform)) c = c.WithMountedCache("/go/pkg/mod", modCache) // setup build cache - buildCache := R.Client.CacheVolume("go-build-" + platform) + buildCache := R.Client.CacheVolume(fmt.Sprintf("go-build-%s-%s", goVer, platform)) c = c.WithMountedCache("/root/.cache/go-build", buildCache) // setup workdir diff --git a/test/dagger/main/hof.go b/test/dagger/main/hof.go index 8be6003f..6df4a088 100644 --- a/test/dagger/main/hof.go +++ b/test/dagger/main/hof.go @@ -21,10 +21,12 @@ func check(err error) { } var RUNTIME string +var ARCH string var TESTS string func init() { pflag.StringVarP(&RUNTIME, "runtime", "r", "docker", "container runtime to use [docker, nerdctl, podman, none]") + pflag.StringVarP(&ARCH, "arch", "a", "amd64", "arch identifier, like golang uses") pflag.StringVarP(&TESTS, "tests", "t", "", "tests to run, comma separated") } @@ -54,10 +56,10 @@ func main() { // // Building // - base := R.GolangImage("linux/amd64") + base := R.GolangImage("linux/"+ARCH) deps := R.FetchDeps(base, source) builder := R.BuildHof(deps, source) - runner := R.RuntimeContainer(builder, "linux/amd64") + runner := R.RuntimeContainer(builder, "linux/"+ARCH) // // TESTS