Skip to content

Commit 140f1f6

Browse files
committed
ci: infer go version from workflow for bsd tests
Signed-off-by: CrazyMax <[email protected]>
1 parent 9684e9a commit 140f1f6

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,8 @@ jobs:
255255
name: Prepare
256256
run: |
257257
echo "VAGRANT_FILE=hack/Vagrantfile.${{ matrix.os }}" >> $GITHUB_ENV
258+
goVersion=$(curl --silent "https://go.dev/dl/?mode=json&include=all" | jq -r '.[].files[].version' | uniq | sed -e 's/go//' | sort -V | grep $GO_VERSION | tail -1)
259+
echo "GO_VERSION=$goVersion" >> $GITHUB_ENV
258260
-
259261
name: Checkout
260262
uses: actions/checkout@v4

hack/Vagrantfile.freebsd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ Vagrant.configure("2") do |config|
99

1010
config.vm.provision "init", type: "shell", run: "once" do |sh|
1111
sh.inline = <<~SHELL
12+
set -x
1213
pkg bootstrap
13-
pkg install -y go123 git
14-
ln -s /usr/local/bin/go123 /usr/local/bin/go
15-
go install gotest.tools/gotestsum@#{ENV['GOTESTSUM_VERSION']}
14+
pkg install -y git
15+
16+
fetch https://go.dev/dl/go#{ENV['GO_VERSION']}.freebsd-amd64.tar.gz
17+
tar -C /usr/local -xzf go#{ENV['GO_VERSION']}.freebsd-amd64.tar.gz
18+
ln -s /usr/local/go/bin/go /usr/local/bin/go
1619
SHELL
1720
end
1821
end

hack/Vagrantfile.netbsd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ Vagrant.configure("2") do |config|
99

1010
config.vm.provision "init", type: "shell", run: "once" do |sh|
1111
sh.inline = <<~SHELL
12+
set -x
1213
mkdir -p /var/tmp
1314
chmod 1777 /var/tmp
1415
1516
pkgin -y install git mozilla-rootcerts
1617
mozilla-rootcerts install
1718
18-
ftp https://go.dev/dl/go1.23.3.netbsd-amd64.tar.gz
19-
tar -C /var/tmp -xzf go1.23.3.netbsd-amd64.tar.gz
19+
ftp https://go.dev/dl/go#{ENV['GO_VERSION']}.netbsd-amd64.tar.gz
20+
tar -C /var/tmp -xzf go#{ENV['GO_VERSION']}.netbsd-amd64.tar.gz
2021
2122
cat << 'EOF' > /usr/bin/go-wrapper
2223
#!/bin/sh

hack/Vagrantfile.openbsd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ Vagrant.configure("2") do |config|
1010

1111
config.vm.provision "init", type: "shell", run: "once" do |sh|
1212
sh.inline = <<~SHELL
13+
set -x
1314
pkg_add -x git
1415
15-
ftp https://go.dev/dl/go1.23.3.openbsd-amd64.tar.gz
16-
tar -C /usr/local -xzf go1.23.3.openbsd-amd64.tar.gz
16+
ftp https://go.dev/dl/go#{ENV['GO_VERSION']}.openbsd-amd64.tar.gz
17+
tar -C /usr/local -xzf go#{ENV['GO_VERSION']}.openbsd-amd64.tar.gz
1718
ln -s /usr/local/go/bin/go /usr/local/bin/go
18-
go install gotest.tools/gotestsum@#{ENV['GOTESTSUM_VERSION']}
1919
SHELL
2020
end
2121
end

0 commit comments

Comments
 (0)