From 0a8d260f44b6b3a866cbba467d6df62706d7bfe8 Mon Sep 17 00:00:00 2001 From: Unrud Date: Mon, 8 May 2023 22:33:02 +0200 Subject: [PATCH] Run tests with github actions --- .github/workflows/test.yaml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..3b23a21 --- /dev/null +++ b/.github/workflows/test.yaml @@ -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 ./...