Add tests for the Steam Runtime

Closes #1733
This commit is contained in:
Hajime Hoshi 2021-07-28 23:14:44 +09:00
parent c06e8a5501
commit e5254482fe
2 changed files with 41 additions and 0 deletions

13
.github/workflows/steam.sh vendored Normal file
View File

@ -0,0 +1,13 @@
export PATH=$PATH:/usr/local/go/bin
export CGO_CFLAGS=-std=gnu99
export DISPLAY=:99.0
# Install Go
curl -L --output go${1}.linux-amd64.tar.gz https://golang.org/dl/go${1}.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go${1}.linux-amd64.tar.gz
# Run X
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# Run the tests
go test -tags=example -v ./...

28
.github/workflows/steam.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: steam
on: [push, pull_request]
jobs:
test:
name: Test with Steam Runtime
runs-on: ubuntu-latest
env:
DISPLAY: ':99.0'
STEAM_RUNTIME_VERSION: '0.20210630.0'
GO_VERSION: '1.16.6'
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker build
run: |
curl -L --output com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.Dockerfile https://repo.steampowered.com/steamrt-images-scout/snapshots/${STEAM_RUNTIME_VERSION}/com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.Dockerfile
curl -L --output com.valvesoftware.SteamRuntime.Sdk-amd64,i386-scout-sysroot.tar.gz https://repo.steampowered.com/steamrt-images-scout/snapshots/${STEAM_RUNTIME_VERSION}/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: Docker run
run: |
docker run --rm --workdir=/work --volume $(pwd):/work steamrt_scout_amd64:latest /bin/sh .github/workflows/steam.sh ${GO_VERSION}