fix minor bugs, add close handler #33
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 | |
permissions: read-all | |
on: | |
push: | |
branches: [ main ] | |
tags: [ 'v*.*.*' ] | |
pull_request: | |
workflow_dispatch: # Allow manual runs to kick off benchmarks | |
env: | |
GO_VERSION: 1.19 | |
jobs: | |
code-quality: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Determine paths to cache | |
id: cache | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "go-mod=$(go env GOMODCACHE)">> $GITHUB_OUTPUT | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.cache.outputs.go-build }} | |
${{ steps.cache.outputs.go-mod }} | |
key: ${{ runner.os }}-quality-${{ hashFiles('**/go.sum') }} | |
# This action should, in general, be a no-op, given the cache above. | |
# We also fetch dependencies needed for linting and static analysis, these are not managed in go.mod | |
# because `go mod tidy` would remove them, making dependency management more complicated. | |
- name: Download all deps | |
run: go mod download | |
- name: Lint | |
if: ${{ always() }} | |
run: go run golang.org/x/lint/golint -set_exit_status ./... | |
- name: Static checks | |
if: ${{ always() }} | |
run: go run honnef.co/go/tools/cmd/staticcheck -checks all ./... | |
run-tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
env: | |
COVER_OUT: coverage.out | |
steps: | |
- uses: actions/checkout@v3 | |
- name: et up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Determine paths to cache | |
id: cache | |
run: | | |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "go-mod=$(go env GOMODCACHE)">> $GITHUB_OUTPUT | |
- name: Go Build Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.cache.outputs.go-build }} | |
${{ steps.cache.outputs.go-mod }} | |
key: ${{ runner.os }}-integration-${{ hashFiles('**/go.sum') }} | |
- name: Go Tests | |
run: go test -v -race -coverpkg=./internal/... -covermode=atomic -coverprofile=${{ env.COVER_OUT }} ./... |