Skip to content

[] test

[] test #97

Workflow file for this run

name: Go
on: [pull_request,push]
jobs:
test:
name: Test and Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
name: Setup go
with:
go-version: 1.18
- uses: actions/checkout@v2
name: Checkout code
- name: Cache Go Modules
id: cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go Modules
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: fmt
run: if [[ $(goimports -l $(find . -name "*.go")) ]]; then echo "Please fix your go files formatting (goimports -w \$(find . -name \"*.go\"))"; exit 1; fi
- name: Test
run: go test -v ./...