From bbe036ddf91d68f77a40bda496607122978896c6 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Tue, 11 Feb 2025 00:03:41 +0100 Subject: [PATCH] build and test netbsd Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- .github/workflows/build.yml | 3 ++- Dockerfile | 1 + docker-bake.hcl | 4 ++++ hack/Vagrantfile.netbsd | 23 +++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 hack/Vagrantfile.netbsd diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c06a861ee383..50db99427fbf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -243,6 +243,7 @@ jobs: matrix: os: - freebsd + - netbsd - openbsd steps: - @@ -280,7 +281,7 @@ jobs: - name: Test run: | - vagrant ssh -- "cd /vagrant; SKIP_INTEGRATION_TESTS=1 go test -mod=vendor -coverprofile=coverage.txt -covermode=atomic ${{ env.TESTFLAGS }} ./..." + vagrant ssh -- "cd /vagrant; TMPDIR=/var/tmp SKIP_INTEGRATION_TESTS=1 go test -mod=vendor -coverprofile=coverage.txt -covermode=atomic ${{ env.TESTFLAGS }} ./..." vagrant ssh -c "sudo cat /vagrant/coverage.txt" > coverage.txt - name: Upload coverage diff --git a/Dockerfile b/Dockerfile index 960b7a386d14..45adf9fca2ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,6 +102,7 @@ COPY --link --from=buildx-build /usr/bin/docker-buildx /buildx FROM binaries-unix AS binaries-darwin FROM binaries-unix AS binaries-freebsd FROM binaries-unix AS binaries-linux +FROM binaries-unix AS binaries-netbsd FROM binaries-unix AS binaries-openbsd FROM scratch AS binaries-windows diff --git a/docker-bake.hcl b/docker-bake.hcl index ef01212ae351..a65973faf444 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -48,6 +48,8 @@ target "lint" { "linux/s390x", "linux/ppc64le", "linux/riscv64", + "netbsd/amd64", + "netbsd/arm64", "openbsd/amd64", "openbsd/arm64", "windows/amd64", @@ -167,6 +169,8 @@ target "binaries-cross" { "linux/ppc64le", "linux/riscv64", "linux/s390x", + "netbsd/amd64", + "netbsd/arm64", "openbsd/amd64", "openbsd/arm64", "windows/amd64", diff --git a/hack/Vagrantfile.netbsd b/hack/Vagrantfile.netbsd new file mode 100644 index 000000000000..c90fafbd9ddd --- /dev/null +++ b/hack/Vagrantfile.netbsd @@ -0,0 +1,23 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "generic/netbsd9" + config.vm.boot_timeout = 900 + config.vm.synced_folder ".", "/vagrant", type: "rsync" + config.ssh.keep_alive = true + + config.vm.provision "init", type: "shell", run: "once" do |sh| + sh.inline = <<~SHELL + mkdir -p /var/tmp + chmod 1777 /var/tmp + + pkgin -y install git mozilla-rootcerts + mozilla-rootcerts install + + ftp https://go.dev/dl/go1.23.3.netbsd-amd64.tar.gz + tar -C /var/tmp -xzf go1.23.3.netbsd-amd64.tar.gz + ln -s /var/tmp/go/bin/go /usr/bin/go + SHELL + end +end