-
-
Notifications
You must be signed in to change notification settings - Fork 671
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: FreeBSD | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
# TODO: Get Go versions from https://go.dev/dl/?mode=json | ||
go: ['1.19.13', '1.20.14', '1.21.13', '1.22.6'] | ||
name: Test with Go ${{ matrix.go }} on FreeBSD | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Git | ||
run: | | ||
# See actions/checkout#135 | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test | ||
uses: vmactions/freebsd-vm@v1 | ||
with: | ||
usesh: true | ||
prepare: | | ||
# Install Go | ||
fetch https://go.dev/dl/go${{matrix.go}}.freebsd-amd64.tar.gz | ||
rm -fr /usr/local/go && tar -C /usr/local -xf go${{matrix.go}}.freebsd-amd64.tar.gz | ||
ln -s /usr/local/go/bin/go /usr/local/bin | ||
# Install dependencies | ||
pkg install clang | ||
pkg install alsa-lib libxcursor libxi libxinerama libxrandr mesa-libs pkgconf | ||
# Set up Xvfb | ||
export DISPLAY=':99.0' | ||
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
run: | | ||
# go vet | ||
go vet ./... | ||
go install ./internal/vettools | ||
go vet -vettool=$(which vettools) -v ./... | ||
# go build | ||
go build -v ./... | ||
# Compile without optimization to check potential stack overflow. | ||
# The option '-gcflags=all=-N -l' is often used at Visual Studio Code. | ||
# See also https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md#launch and the issue #2120. | ||
go build "-gcflags=all=-N -l" -v ./... | ||
env GOOS=js GOARCH=wasm go build -v ./... | ||
env GOOS=windows GOARCH=386 go build -v ./... | ||
env GOOS=windows GOARCH=amd64 go build -v ./... | ||
env GOOS=windows GOARCH=arm go build -v ./... | ||
env GOOS=windows GOARCH=arm64 go build -v ./... | ||
# go test | ||
go test -shuffle=on -v -p=1 ./... |