Skip to content

ci: enable linux display test #83

ci: enable linux display test

ci: enable linux display test #83

Workflow file for this run

name: CI
on:
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
matrix:
go-version: [1.21.x]
test-type:
- general
- with-display
platform:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.platform }}
env:
DISPLAY: ':99.0'
EGL_PLATFORM: 'x11'
steps:
- name: install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: non-Go linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -qq libudev-dev
- name: non-Go linux display test dependencies
if: matrix.platform == 'ubuntu-latest' && matrix.test-type == 'with-display'
run: |
sudo apt-get install -qq libxss-dev gcc pkg-config libwayland-dev libx11-dev libx11-xcb-dev libxkbcommon-x11-dev libgles2-mesa-dev libegl1-mesa-dev libffi-dev libxcursor-dev libvulkan-dev xdotool x11-utils xdotool i3-wm
- name: unit tests
if: matrix.test-type == 'general'
run: |
go test ./rpc ./internal/... ./cmd/*/api ./cmd/worklog/store
- name: integration tests
if: matrix.test-type == 'general'
run: |
go test -p=1 -run TestDaemon ./cmd/{rest,runner,worklog} -verbose_log
- name: display integration tests
if: matrix.test-type == 'with-display'
run: |
echo "DISPLAY=${DISPLAY}"
# Start a virtual frame buffer...
Xvfb :99 -screen 0 1920x1024x24 &
# wait a bit for it to be ready...
sleep 1
# and a window manager to get focus for testers
i3 &
# and wait again.
sleep 1
go test -p=1 -run TestDaemon ./cmd/watcher -verbose_log