Skip to content

Commit 3c80dcf

Browse files
andrewkrohv1v
andauthored
.github/workflows/go.yml - Add testing on FreeBSD (#204)
Add GH action step test execute unit tests on FreeBSD 14.0. The tests run inside of a qemu VM running on top of a linux worker. Until a FreeBSD provider is present this step will test nothing. It will become active as soon as files exist in 'providers/freebsd/'. Relates: #126 --------- Co-authored-by: Victor Martinez <[email protected]>
1 parent cd7d9cf commit 3c80dcf

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/go.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,35 @@ jobs:
9494
- name: Test
9595
if: runner.os == 'Windows'
9696
run: .ci/scripts/test.bat
97+
98+
test-freebsd:
99+
runs-on: ubuntu-latest
100+
env:
101+
# Only GITHUB_* are passed into the VM.
102+
GITHUB_GOLANG_VERSION: 1.22.1
103+
name: test (1.22.1, freebsd-14.0, cgo)
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- name: Test
108+
# TODO: Skip until freebsd provider is merged. Then this 'if' should be removed.
109+
if: ${{ hashFiles('providers/freebsd/') != '' }}
110+
id: test
111+
uses: vmactions/freebsd-vm@35a5b20a98476a681c7576a344775be7e7f77f06 #v1.0.6
112+
with:
113+
usesh: true
114+
prepare: |
115+
freebsd-version
116+
pwd
117+
ls -lah
118+
whoami
119+
120+
pkg install -y curl
121+
curl -sL -o /usr/bin/gvm https://github.com/andrewkroh/gvm/releases/download/v0.5.2/gvm-freebsd-amd64
122+
chmod +x /usr/bin/gvm
123+
eval "$(gvm ${GITHUB_GOLANG_VERSION})"
124+
go version
125+
126+
run: |
127+
eval "$(gvm ${GITHUB_GOLANG_VERSION})"
128+
go test -v ./...

0 commit comments

Comments
 (0)