diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2d075d7..d5a1037a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,9 +128,19 @@ jobs: flags: unit,go-${{ matrix.go }} token: ${{ secrets.CODECOV_TOKEN }} - test-freebsd-amd64: + test-bsd-amd64: runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + os: + - freebsd + - openbsd steps: + - + name: Prepare + run: | + echo "VAGRANT_FILE=hack/Vagrantfile.${{ matrix.os }}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 @@ -139,9 +149,9 @@ jobs: uses: actions/cache@v4 with: path: ~/.vagrant.d/boxes - key: ${{ runner.os }}-vagrant-${{ hashFiles('hack/Vagrantfile.freebsd') }} + key: ${{ runner.os }}-vagrant-${{ matrix.os }}-${{ hashFiles(env.VAGRANT_FILE) }} restore-keys: | - ${{ runner.os }}-vagrant- + ${{ runner.os }}-vagrant-${{ matrix.os }}- - name: Install vagrant run: | @@ -155,7 +165,7 @@ jobs: - name: Set up vagrant run: | - ln -sf hack/Vagrantfile.freebsd Vagrantfile + ln -sf ${{ env.VAGRANT_FILE }} Vagrantfile vagrant up --no-tty - name: Test @@ -172,5 +182,5 @@ jobs: uses: codecov/codecov-action@v4 with: file: ./coverage.txt - flags: unit,freebsd + flags: unit,${{ matrix.os }} token: ${{ secrets.CODECOV_TOKEN }} diff --git a/docker-bake.hcl b/docker-bake.hcl index a18986bc..fe195db2 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -87,5 +87,20 @@ target "shfmt" { target "cross" { inherits = ["build"] - platforms = ["linux/amd64", "linux/386", "linux/arm64", "linux/arm", "linux/ppc64le", "linux/s390x", "darwin/amd64", "darwin/arm64", "windows/amd64", "windows/arm64", "freebsd/amd64", "freebsd/arm64"] + platforms = [ + "linux/amd64", + "linux/386", + "linux/arm64", + "linux/arm", + "linux/ppc64le", + "linux/s390x", + "darwin/amd64", + "darwin/arm64", + "windows/amd64", + "windows/arm64", + "freebsd/amd64", + "freebsd/arm64", + "openbsd/amd64", + "openbsd/arm64" + ] } diff --git a/hack/Vagrantfile.freebsd b/hack/Vagrantfile.freebsd index 2d81a719..5a16f248 100644 --- a/hack/Vagrantfile.freebsd +++ b/hack/Vagrantfile.freebsd @@ -10,8 +10,8 @@ Vagrant.configure("2") do |config| config.vm.provision "init", type: "shell", run: "once" do |sh| sh.inline = <<~SHELL pkg bootstrap - pkg install -y go121 - ln -s /usr/local/bin/go121 /usr/local/bin/go + pkg install -y go123 + ln -s /usr/local/bin/go123 /usr/local/bin/go SHELL end end diff --git a/hack/Vagrantfile.openbsd b/hack/Vagrantfile.openbsd new file mode 100644 index 00000000..e69a424e --- /dev/null +++ b/hack/Vagrantfile.openbsd @@ -0,0 +1,17 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.box = "generic/openbsd7" + 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 + ftp https://go.dev/dl/go1.23.2.openbsd-amd64.tar.gz + tar -C /usr/local -xzf go1.23.2.openbsd-amd64.tar.gz + ln -s /usr/local/go/bin/go /usr/local/bin/go + SHELL + end +end