Skip to content

Commit

Permalink
.github/workflows: add freebsd.yml
Browse files Browse the repository at this point in the history
Closes #2720
  • Loading branch information
hajimehoshi committed Aug 12, 2024
1 parent 435c8b7 commit efd5e64
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/freebsd.yml
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 -y clang
pkg install -y 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 ./...

0 comments on commit efd5e64

Please sign in to comment.