Skip to content

Remove noisy printf which was meant for debug (#4) #18

Remove noisy printf which was meant for debug (#4)

Remove noisy printf which was meant for debug (#4) #18

name: Go build and test
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
- release/v*
env:
GO_VERSION: "^1.20.3"
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Restore cache
id: go-cache
uses: actions/cache/restore@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: go-${{ inputs.GO_WORKING_DIR }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-${{ inputs.GO_WORKING_DIR }}-
- run: go mod download
- run: go vet .
- run: go build ./...
- run: go test ./...
# If triggered from non-PR setup, save the cache.
- name: Save cache
if: github.event_name != 'pull_request'
uses: actions/cache/save@v3
with:
key: ${{ steps.go-cache.outputs.cache-primary-key }}
# Any location that we generate the test coverage report in
path: |
~/.cache/coverage.txt
~/.cache/go-build
~/go/pkg/mod