Skip to content

Commit 1c491fb

Browse files
committed
ci(test-os): cross build freebsd binaries using the Dockerfile
Signed-off-by: CrazyMax <[email protected]>
1 parent 12bbf07 commit 1c491fb

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

.github/workflows/test-os.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ env:
2323
TESTFLAGS: "-v --parallel=6 --timeout=30m"
2424
GOTESTSUM_VERSION: "v1.9.0" # same as one in Dockerfile
2525
GOTESTSUM_FORMAT: "standard-verbose"
26+
DESTDIR: "./bin"
2627

2728
jobs:
2829
test:
@@ -89,8 +90,35 @@ jobs:
8990
if: failure()
9091
uses: crazy-max/ghaction-dump-context@v2
9192

93+
build-freebsd-amd64:
94+
runs-on: ubuntu-22.04
95+
steps:
96+
-
97+
name: Checkout
98+
uses: actions/checkout@v4
99+
-
100+
name: Set up Docker Buildx
101+
uses: docker/setup-buildx-action@v2
102+
-
103+
name: Build
104+
uses: docker/bake-action@v3
105+
with:
106+
targets: binaries
107+
set: |
108+
*.platform=freebsd/amd64
109+
-
110+
name: Upload artifacts
111+
uses: actions/upload-artifact@v3
112+
with:
113+
name: buildkit-freebsd-amd64
114+
path: ${{ env.DESTDIR }}/*
115+
if-no-files-found: error
116+
retention-days: 1
117+
92118
test-freebsd-amd64:
93119
runs-on: macos-12
120+
needs:
121+
- build-freebsd-amd64
94122
env:
95123
VAGRANT_VAGRANTFILE: hack/Vagrantfile.freebsd13
96124
GOOS: freebsd
@@ -99,18 +127,11 @@ jobs:
99127
name: Checkout
100128
uses: actions/checkout@v4
101129
-
102-
name: Set up Go
103-
uses: actions/setup-go@v4
130+
name: Download artifacts
131+
uses: actions/download-artifact@v3
104132
with:
105-
go-version: "${{ env.GO_VERSION }}"
106-
107-
- name: Build buildkitd binary
108-
run: |
109-
go build ./cmd/buildkitd
110-
111-
- name: Build buildctl binary
112-
run: |
113-
go build ./cmd/buildctl
133+
name: buildkit-freebsd-amd64
134+
path: ${{ env.DESTDIR }}
114135
-
115136
name: Cache Vagrant boxes
116137
uses: actions/cache@v3

hack/Vagrantfile.freebsd13

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Vagrant.configure("2") do |config|
2323
#!/usr/bin/env bash
2424
set -eux -o pipefail
2525
cd /vagrant
26-
install -m 755 buildkitd /usr/local/bin/buildkitd
26+
install -m 755 bin/buildkitd /usr/local/bin/buildkitd
2727
type /usr/local/bin/buildkitd
2828
buildkitd --version
2929
SHELL
@@ -34,7 +34,7 @@ Vagrant.configure("2") do |config|
3434
#!/usr/bin/env bash
3535
set -eux -o pipefail
3636
cd /vagrant
37-
install -m 755 buildctl /usr/local/bin/buildctl
37+
install -m 755 bin/buildctl /usr/local/bin/buildctl
3838
type /usr/local/bin/buildctl
3939
SHELL
4040
end

0 commit comments

Comments
 (0)