Skip to content

Add checkout to labeler #48

Add checkout to labeler

Add checkout to labeler #48

Workflow file for this run

name: Go
on: [push,pull_request]
jobs:
test:
name: Test and Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout code
- uses: actions/setup-go@v4
name: Setup Go
with:
go-version-file: "go.mod"
- 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: fmt
run: if [[ $(go fmt ./...) ]]; then echo "Please fix your go files formatting (go fmt ./...)"; exit 1; fi
- name: Test
run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./...
- uses: codecov/codecov-action@v3