Add more tests for plots and window (#46) #198
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libgl1-mesa-dev xorg-dev | |
go get . | |
- name: Build Linux | |
run: GOOS=linux GOARCH=amd64 go build ./... | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libgl1-mesa-dev xorg-dev xvfb | |
go get . | |
- name: Build | |
run: go build -v ./... | |
- name: Run tests | |
run: | | |
xvfb-run go test -v ./... -covermode=count -coverprofile="coverage.out" | |
go tool cover -func="coverage.out" | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
path-to-lcov: coverage.out | |
lint: | |
name: Run linters | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y libgl1-mesa-dev xorg-dev | |
go get . | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
go install github.com/gordonklaus/ineffassign@latest | |
- name: Check format | |
run: | | |
if gofmt -e -l . >&1 | grep '^'; then | |
exit 1 | |
fi | |
- name: Lint with vet | |
run: go vet ./... | |
- name: Lint with staticcheck | |
run: staticcheck ./... | |
- name: Lint with ineffassign | |
run: ineffassign ./... | |
semver: | |
name: Run SemVer check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21.x' | |
- name: Install dependencies | |
run: | | |
go get . | |
go install golang.org/x/exp/cmd/gorelease@latest | |
- name: Run gorelease | |
run: gorelease |