Skip to content

Commit

Permalink
.github/workflows/go.yml - Add testing on FreeBSD (#204)
Browse files Browse the repository at this point in the history
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 <victormartinezrubio@gmail.com>
  • Loading branch information
andrewkroh and v1v authored Mar 14, 2024
1 parent cd7d9cf commit 3c80dcf
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,35 @@ jobs:
- name: Test
if: runner.os == 'Windows'
run: .ci/scripts/test.bat

test-freebsd:
runs-on: ubuntu-latest
env:
# Only GITHUB_* are passed into the VM.
GITHUB_GOLANG_VERSION: 1.22.1
name: test (1.22.1, freebsd-14.0, cgo)
steps:
- uses: actions/checkout@v4

- name: Test
# TODO: Skip until freebsd provider is merged. Then this 'if' should be removed.
if: ${{ hashFiles('providers/freebsd/') != '' }}
id: test
uses: vmactions/freebsd-vm@35a5b20a98476a681c7576a344775be7e7f77f06 #v1.0.6
with:
usesh: true
prepare: |
freebsd-version
pwd
ls -lah
whoami
pkg install -y curl
curl -sL -o /usr/bin/gvm https://github.com/andrewkroh/gvm/releases/download/v0.5.2/gvm-freebsd-amd64
chmod +x /usr/bin/gvm
eval "$(gvm ${GITHUB_GOLANG_VERSION})"
go version
run: |
eval "$(gvm ${GITHUB_GOLANG_VERSION})"
go test -v ./...

0 comments on commit 3c80dcf

Please sign in to comment.