update purego to v0.4.1 #200
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
name: Test | |
on: [push, pull_request] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
go: ['1.18.x', '1.19.x', '1.20.x', '1.21.0-rc.3'] | |
name: Test with Go ${{ matrix.go }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
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@v2 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install dependencies | |
if: ${{ startsWith(matrix.os, 'ubuntu-') }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install libasound2-dev | |
- name: go vet | |
if: ${{ !startsWith(matrix.os, 'windows-') && !startsWith(matrix.os, 'macos-') }} | |
run: | | |
go vet -tags=example -v ./... | |
- name: go build | |
run: | | |
go build -tags=example -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 hajimehoshi/ebiten#2120. | |
go build -tags=example "-gcflags=all=-N -l" -v ./... | |
# Check cross-compiling WebAssembly. | |
# Unfortunately it is difficult to test Oto on browsers since this requires user interactions. | |
env GOOS=js GOARCH=wasm go build -tags=example -v ./... | |
# Check cross-compiling Windows binaries. | |
env GOOS=windows GOARCH=386 go build -tags=example -v ./... | |
env GOOS=windows GOARCH=amd64 go build -tags=example -v ./... | |
env GOOS=windows GOARCH=arm go build -tags=example -v ./... | |
env GOOS=windows GOARCH=arm64 go build -tags=example -v ./... | |
# Check cross-compiling macOS binaries. | |
env GOOS=darwin GOARCH=amd64 go build -tags=example -v ./... | |
env GOOS=darwin GOARCH=arm64 go build -tags=example -v ./... | |
- name: go mod vendor | |
run: | | |
mkdir /tmp/vendoring | |
cd /tmp/vendoring | |
go mod init foo | |
echo 'package main' > main.go | |
echo 'import (' >> main.go | |
echo ' _ "github.com/hajimehoshi/oto/v2"' >> main.go | |
echo ')' >> main.go | |
echo 'func main() {}' >> main.go | |
go mod edit -replace github.com/hajimehoshi/oto/v2=$GITHUB_WORKSPACE | |
go mod tidy | |
go mod vendor | |
go build -v . | |
- name: go test | |
run: | | |
go test -tags=example -shuffle=on -v -count=10 ./... |