Skip to content

Commit

Permalink
build and test openbsd
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Nov 2, 2024
1 parent 2406230 commit 8aa8a3b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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 }}
17 changes: 16 additions & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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/arm64",
"openbsd/arm64"
]
}
4 changes: 2 additions & 2 deletions hack/Vagrantfile.freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 16 additions & 0 deletions hack/Vagrantfile.openbsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- 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
pkg_add go-1.23
ln -s /usr/local/go/bin/go /usr/local/bin/go
SHELL
end
end

0 comments on commit 8aa8a3b

Please sign in to comment.