mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-12 06:24:10 +01:00
docker: switch away from Nix to build Docker images
This should be faster to build multiarch images, as Nix requires emulation, while we can build everything natively using builtin Go cross-compilation support. Moreover, caching should be better. Also, add Nix build to CI. Also, build more architectures (linux/arm/v7).
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"runtime"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -26,10 +27,18 @@ func TestVersion(t *testing.T) {
|
||||
want := []string{
|
||||
"akvorado dev",
|
||||
fmt.Sprintf(" Built with: %s", runtime.Version()),
|
||||
fmt.Sprintf(" Build setting GOARCH=%s", runtime.GOARCH),
|
||||
fmt.Sprintf(" Build setting GOOS=%s", runtime.GOOS),
|
||||
"",
|
||||
}
|
||||
got := strings.Split(buf.String(), "\n")[:len(want)]
|
||||
if diff := helpers.Diff(got, want); diff != "" {
|
||||
got := strings.Split(buf.String(), "\n")
|
||||
got = slices.DeleteFunc(got, func(s string) bool {
|
||||
return strings.HasPrefix(s, " Build setting") &&
|
||||
!strings.HasPrefix(s, " Build setting GOOS") &&
|
||||
!strings.HasPrefix(s, " Build setting GOARCH")
|
||||
})
|
||||
|
||||
if diff := helpers.Diff(got[:len(want)], want); diff != "" {
|
||||
t.Errorf("`version` (-got, +want):\n%s", diff)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user