chore(deps): update actions/checkout action to v4 #15
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: Code Quality | |
on: [pull_request] | |
jobs: | |
formatting: | |
name: go fmt | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get dependencies | |
run: go mod download | |
- name: Formatting | |
run: diff <(gofmt -d ./...) <(echo -n) | |
generate: | |
name: go generate | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17 | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get dependencies | |
run: go mod download | |
- name: stringer | |
run: go get golang.org/x/tools/cmd/stringer | |
- name: go generate | |
run: go generate | |
- name: validate generated code | |
run: git diff --exit-code -- . ':(exclude)go.sum' ':(exclude)go.mod' |