mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-12 03:58:55 +01:00
test
This commit is contained in:
parent
125dc1ab8c
commit
4d5261d180
41
.github/workflows/steam.yml
vendored
41
.github/workflows/steam.yml
vendored
@ -1,41 +0,0 @@
|
||||
name: Steam
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Test with Steam Runtime
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DISPLAY: ':99.0'
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Docker build (386)
|
||||
run: |
|
||||
curl --location --remote-name https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-public-beta/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.Dockerfile
|
||||
curl --location --remote-name https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-public-beta/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
|
||||
docker build -f com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.Dockerfile -t steamrt_scout_i386:latest .
|
||||
|
||||
- name: Docker build (amd64)
|
||||
run: |
|
||||
curl --location --remote-name https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-public-beta/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.Dockerfile
|
||||
curl --location --remote-name https://repo.steampowered.com/steamrt-images-scout/snapshots/latest-public-beta/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.tar.gz
|
||||
docker build -f com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.Dockerfile -t steamrt_scout_amd64:latest .
|
||||
|
||||
- name: Go version
|
||||
id: go
|
||||
run: |
|
||||
echo "::set-output name=version::$(curl --location https://go.dev/VERSION?m=text)"
|
||||
|
||||
- name: Docker run (386)
|
||||
run: |
|
||||
docker run --rm --workdir=/work --volume $(pwd):/work --env GO_FILENAME=${{ steps.go.outputs.version }}.linux-386.tar.gz steamrt_scout_i386:latest /bin/sh .github/workflows/steam.sh
|
||||
|
||||
- name: Docker run (amd64)
|
||||
run: |
|
||||
docker run --rm --workdir=/work --volume $(pwd):/work --env GO_FILENAME=${{ steps.go.outputs.version }}.linux-amd64.tar.gz steamrt_scout_amd64:latest /bin/sh .github/workflows/steam.sh
|
125
.github/workflows/test.yml
vendored
125
.github/workflows/test.yml
vendored
@ -6,8 +6,8 @@ jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
go: ['1.18.x', '1.19.x', '1.20.0-rc.3']
|
||||
os: [windows-latest]
|
||||
go: ['1.19.x']
|
||||
name: Test with Go ${{ matrix.go }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
@ -31,133 +31,14 @@ jobs:
|
||||
go-version: ${{ matrix.go }}
|
||||
cache: true
|
||||
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
||||
- name: Install dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
|
||||
|
||||
- name: Install wasmbrowsertest
|
||||
run: |
|
||||
go install github.com/agnivade/wasmbrowsertest@8753b3a64e2d666fd88734888f26e48c68882f5f
|
||||
mv $(go env GOPATH)/bin/wasmbrowsertest${{ runner.os == 'Windows' && '.exe' || '' }} $(go env GOPATH)/bin/go_js_wasm_exec${{ runner.os == 'Windows' && '.exe' || '' }}
|
||||
|
||||
- name: Prepare ebitenmobile test
|
||||
run: |
|
||||
cd /tmp
|
||||
git clone --depth=1 https://github.com/hajimehoshi/go-inovation
|
||||
cd go-inovation
|
||||
go mod edit -replace=github.com/hajimehoshi/ebiten/v2=$GITHUB_WORKSPACE
|
||||
go mod tidy
|
||||
|
||||
- name: Xvfb
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
||||
|
||||
- name: go vet
|
||||
run: |
|
||||
go list ./... | grep -v -x -F -f .github/workflows/govetblock.txt | xargs go vet
|
||||
|
||||
- name: go vet (vettool)
|
||||
run: |
|
||||
(cd .github/workflows/vettools; go install .)
|
||||
go vet -vettool=$(which vettools)${{ runner.os == 'Windows' && '.exe' || '' }} -v ./...
|
||||
|
||||
- name: go build
|
||||
run: |
|
||||
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 ./...
|
||||
|
||||
- name: go build (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -v ./...
|
||||
env CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -o flappy_amd64 -v ./examples/flappy
|
||||
env CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -o flappy_arm64 -v ./examples/flappy
|
||||
lipo -create flappy_amd64 flappy_arm64 -output flappy
|
||||
file flappy
|
||||
rm flappy
|
||||
|
||||
- name: go build (NintendoSDK)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
go build -tags=nintendosdk -v ./...
|
||||
|
||||
- name: go mod vendor
|
||||
run: |
|
||||
mkdir /tmp/vendoring
|
||||
cd /tmp/vendoring
|
||||
go mod init foo
|
||||
# TODO: Is there a way to create a complete list of Ebitengine sub-packages?
|
||||
echo 'package main' > main.go
|
||||
echo 'import (' >> main.go
|
||||
echo ' _ "github.com/hajimehoshi/ebiten/v2"' >> main.go
|
||||
echo ' _ "github.com/hajimehoshi/ebiten/v2/audio"' >> main.go
|
||||
echo ')' >> main.go
|
||||
echo 'func main() {}' >> main.go
|
||||
go mod edit -replace github.com/hajimehoshi/ebiten/v2=$GITHUB_WORKSPACE
|
||||
go mod tidy
|
||||
go mod vendor
|
||||
go build -v .
|
||||
|
||||
- name: go test
|
||||
# TODO: Add more test environments (#1305)
|
||||
if: runner.os == 'Linux' || runner.os == 'Windows'
|
||||
run: |
|
||||
go test -shuffle=on -v ./...
|
||||
|
||||
- name: go test (Linux 386)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-multilib
|
||||
sudo apt-get install libasound2-dev:i386 libgl1-mesa-dev:i386 libxcursor-dev:i386 libxi-dev:i386 libxinerama-dev:i386 libxrandr-dev:i386 libxxf86vm-dev:i386
|
||||
env CGO_ENABLED=1 GOARCH=386 go test -shuffle=on -v ./...
|
||||
|
||||
- name: go test (Linux OpenGL ES)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get install libgles2-mesa-dev
|
||||
env EBITENGINE_GRAPHICS_LIBRARY=opengl EBITENGINE_OPENGL=es go test -shuffle=on -v ./...
|
||||
|
||||
- name: go test (Windows 386)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
env GOARCH=386 go test -shuffle=on -v ./...
|
||||
|
||||
- name: go test (Wasm)
|
||||
run: |
|
||||
env
|
||||
${{ runner.os == 'Windows' && 'unset $(env | awk -F= "{print $1}" | grep -v -x -e "^(PATH|TEMP|TMP)$")' || '' }}
|
||||
env GOOS=js GOARCH=wasm go test -shuffle=on -v ./...
|
||||
env GOOS=js GOARCH=wasm EBITENGINE_OPENGL=webgl1 go test -shuffle=on -v ./...
|
||||
|
||||
- name: Install ebitenmobile
|
||||
run: |
|
||||
go install ./cmd/ebitenmobile
|
||||
|
||||
- name: ebitenmobile bind (Android)
|
||||
run: |
|
||||
cd /tmp/go-inovation
|
||||
ebitenmobile bind -target android -androidapi 19 -javapkg com.hajimehoshi.goinovation -o inovation.aar -v github.com/hajimehoshi/go-inovation/mobile
|
||||
|
||||
- name: ebitenmobile bind (iOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
cd /tmp/go-inovation
|
||||
ebitenmobile bind -target ios -o Inovation.xcframework -v github.com/hajimehoshi/go-inovation/mobile
|
||||
|
47
.github/workflows/vuln.yml
vendored
47
.github/workflows/vuln.yml
vendored
@ -1,47 +0,0 @@
|
||||
name: Vulnerability Check
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
go: ['1.18.10', '1.19.5']
|
||||
name: Vulnerability Check with Go ${{ matrix.go }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
DISPLAY: ':99.0'
|
||||
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 }}
|
||||
cache: true
|
||||
|
||||
- name: Install govulncheck
|
||||
run: |
|
||||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
|
||||
- name: Install dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install libasound2-dev libgl1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
|
||||
|
||||
- name: govulncheck
|
||||
run: |
|
||||
govulncheck ./...
|
||||
env GOOS=js GOARCH=wasm govulncheck ./...
|
Loading…
Reference in New Issue
Block a user