Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub Actions #939

Closed
hajimehoshi opened this issue Sep 20, 2019 · 6 comments
Closed

Use GitHub Actions #939

hajimehoshi opened this issue Sep 20, 2019 · 6 comments
Milestone

Comments

@hajimehoshi
Copy link
Owner

It looks like Windows GUI is available!

@hajimehoshi hajimehoshi added this to the v1.10.0 milestone Sep 29, 2019
@silbinarywolf
Copy link
Contributor

Hey!

I've been messing around with this today but ended up hitting the following issue with regards to OpenGL.

I figure I'll paste what I've figured out so far here so that you have somewhere to start :)

Github Actions output:

Run export DISPLAY=:99.0
# github.com/go-gl/glfw/v3.2/glfw
In file included from ../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/c_glfw_linbsd.go:24:0:
../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/linux_joystick.c: In function ‘_glfwInitJoysticksLinux’:
##[error]../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/linux_joystick.c:224:42: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 9 [-Wformat-truncation=]
             snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
                                          ^~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from /usr/include/X11/Xcursor/Xcursor.h:26,
                 from ../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/x11_platform.h:39,
                 from ../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/internal.h:169,
                 from ../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/glfw/src/x11_init.c:28,
                 from ../../../go/pkg/mod/github.com/go-gl/glfw@v0.0.0-20190409004039-e6da0acd62b1/v3.2/glfw/c_glfw_linbsd.go:19:
##[error]/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 12 and 267 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019/10/19 11:45:38 PlatformError: X11: RandR gamma ramp support seems broken
GLFW: An uncaught error has occurred: APIUnavailable: GLX: No GLXFBConfigs returned
GLFW: Please report this bug in the Go package immediately.
GLFW: An invalid error was not accepted by the caller: FormatUnavailable: GLX: Failed to find a suitable GLXFBConfig
GLFW: Please report this bug in the Go package immediately.
panic: FormatUnavailable: GLX: Failed to find a suitable GLXFBConfig

Badge:
Actions Status

[![Actions Status](https://github.com/silbinarywolf/gml-go/workflows/Go/badge.svg)](https://github.com/silbinarywolf/gml-go/actions)

Based on this sample:

[![Actions Status](https://github.com/{owner}/{repo}/workflows/{workflow-name}/badge.svg)](https://github.com/{owner}/{repo}/actions)

go.yml

name: Go
on: [push]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.12
      uses: actions/setup-go@v1
      with:
        go-version: 1.12
      id: go

    - name: Set up *nix dependencies
      run: |
        sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r"
        sudo apt-get install libasound2-dev libglew-dev libgles2-mesa-dev libalut-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev

    - name: Check out code into the Go module directory
      uses: actions/checkout@v1

    - name: Get Go dependencies
      run: |
        export GO111MODULE=on
        go mod download
        go get -v

    - name: Generate and Build
      run: |
        export PATH=${PATH}:`go env GOPATH`/bin
        go install -v -tags debug ./gml
        go install -v -tags headless ./gml
        go install -v -tags "debug headless" ./gml
        go install -v ./gml
        go install -v ./cmd/gmlgo
        gmlgo generate -v ./example/...
        go build -tags debug -v ./example/...
        go build -tags headless -v ./example/...
        go build -tags "debug headless" -v ./example/...
        go build -v ./example/...

    - name: Test
      run: |
        export DISPLAY=:99.0
        Xvfb :99 &
        go test -v ./gml/...
        go test -tags debug -v ./gml/...
        go test -tags headless -v ./gml/...
        go test -tags "debug headless" -v ./gml/...
        go test -v ./cmd/...
        go test -tags "debug headless" -coverprofile="coverage_spaceship.out" -coverpkg=$(go list ./example/spaceship/game) ./example/spaceship/test
        go test -tags "debug headless" -coverprofile="coverage_worm.out" -coverpkg=$(go list ./example/worm/game) ./example/worm/test

    - name: Publish
      run: |
        gmlgo publish -v ./example/spaceship

@hajimehoshi
Copy link
Owner Author

https://github.com/hajimehoshi/ebiten/runs/240725659

Yes this is the same situation, but at least running Linux succeeded.

@silbinarywolf
Copy link
Contributor

Ah thanks for showing me yours! I was starting Xvfb incorrectly!

@hajimehoshi hajimehoshi removed this from the v1.10.0 milestone Oct 20, 2019
@tommyblue
Copy link

This is the script I use to test an ebiten app in github:

name: Go

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.14
      uses: actions/setup-go@v1
      with:
        go-version: 1.14
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2

    - name: Install packages
      run: |
        sudo apt update
        sudo apt install -y  build-essential libalut-dev libasound2-dev libc6-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev mesa-utils pkg-config xorg-dev xvfb

    - name: Get dependencies
      run: |
        go get -v -t -d ./...
        if [ -f Gopkg.toml ]; then
            curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
            dep ensure
        fi

    - name: Test
      env:
        DISPLAY: ":99.0"
      run: |
        xvfb-run --auto-servernum  go test -race -v ./...

@hajimehoshi hajimehoshi added this to the v1.12.0 milestone May 5, 2020
@hajimehoshi
Copy link
Owner Author

https://foundation.travis-ci.org/2020/06/15/foundation-update/ That's unfortunate, but TravisCI might become unavailable soon.

@hajimehoshi
Copy link
Owner Author

Note: Dockerfile for an Android emulator environment: https://github.com/golang/build/blob/master/env/android-amd64-emu/Dockerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants