Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build and test openbsd #216

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/amd64",
"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
17 changes: 17 additions & 0 deletions hack/Vagrantfile.openbsd
Original file line number Diff line number Diff line change
@@ -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