cmd/worklog: add dashboard data endpoint tests #75
Workflow file for this run
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: 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 | |
exclude: | |
- platform: ubuntu-latest | |
test-type: with-display | |
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 | |
# Start a virtual frame buffer. | |
Xvfb :99 -screen 0 1920x1024x24 & | |
- 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: | | |
go test -p=1 -run TestDaemon ./cmd/watcher -verbose_log |