Fix myriad of spellcheck errors. (#20) #9
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: Vet, Check and Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
GO_VERSION: '1.20' | |
jobs: | |
vet-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: false | |
- name: Get Go cache directories | |
id: get-cache-dirs | |
run: | | |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_OUTPUT | |
echo "GOBIN=$(go env GOBIN)" >> $GITHUB_OUTPUT | |
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
- name: Cache Go | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.get-cache-dirs.outputs.GOCACHE }} | |
${{ steps.get-cache-dirs.outputs.GOPATH }} | |
${{ steps.get-cache-dirs.outputs.GOBIN }} | |
${{ steps.get-cache-dirs.outputs.GOMODCACHE }} | |
key: ${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-${{ runner.arch }}-${{ github.job }}- | |
- name: Verify dependencies | |
run: go mod verify | |
- name: Run go vet | |
run: go vet ./... | |
- name: Install staticcheck | |
run: go install honnef.co/go/tools/cmd/staticcheck@2023.1.2 | |
- name: Run staticcheck | |
run: staticcheck ./... | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
cache: false | |
- name: Get Go cache directories | |
id: get-cache-dirs | |
run: | | |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_OUTPUT | |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_OUTPUT | |
echo "GOBIN=$(go env GOBIN)" >> $GITHUB_OUTPUT | |
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT | |
- name: Cache Go | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ steps.get-cache-dirs.outputs.GOCACHE }} | |
${{ steps.get-cache-dirs.outputs.GOPATH }} | |
${{ steps.get-cache-dirs.outputs.GOBIN }} | |
${{ steps.get-cache-dirs.outputs.GOMODCACHE }} | |
key: ${{ runner.os }}-${{ runner.arch }}-${{ github.job }}-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-${{ runner.arch }}-${{ github.job }}- | |
- name: Run tests | |
run: go test -v -race -vet=off ./... |