Run tests with github actions

This commit is contained in:
Unrud 2023-05-08 22:33:02 +02:00
parent 722678ca4f
commit 0a8d260f44

37
.github/workflows/test.yaml vendored Normal file
View file

@ -0,0 +1,37 @@
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ubuntu-stable]
go: [stable, oldstable]
GOOS: [linux]
GOFLAGS: ['', 'null', 'portal', 'uinput', 'x11',
'null,portal,uinput,x11']
runs-on: ${{ matrix.os }}
env:
GOOS: ${{ matrix.GOOS }}
GOFLAGS: ${{ matrix.GOFLAGS }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Go Format
run: gofmt -s -w . && git diff --exit-code
- name: Go Vet
run: go vet ./...
- name: Go Mod Tidy
run: go mod tidy && git diff --exit-code
- name: Go Build
run: go build ./...
- name: Go Test
run: go test -race ./...