Skip to content

Commit 18f4275

Browse files
authored
Merge pull request #2995 from crazy-max/ci-infer-goversion-bsd
ci: infer go version from workflow for bsd tests
2 parents 221a608 + cc0391e commit 18f4275

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.github/workflows/build.yml

+4
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@ jobs:
264264
name: Prepare
265265
run: |
266266
echo "VAGRANT_FILE=hack/Vagrantfile.${{ matrix.os }}" >> $GITHUB_ENV
267+
268+
# Sets semver Go version to be able to download tarball during vagrant setup
269+
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)
270+
echo "GO_VERSION=$goVersion" >> $GITHUB_ENV
267271
-
268272
name: Checkout
269273
uses: actions/checkout@v4

hack/Vagrantfile.freebsd

+6-3
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.openbsd

+3-3
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)