Skip to content

Commit

Permalink
Add build tags and skipGenerate (#95)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Kovalov <oleg@hey.com>
  • Loading branch information
cristaloleg committed Mar 1, 2024
1 parent b59fd39 commit d2abbfe
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ on:
default: false
required: false
type: boolean
skipGenerate:
description: 'Skip "go generate"'
default: true
required: false
type: boolean
buildTags:
description: 'Build tags to use. Default is "1" which works as no-op'
default: '1'
required: false
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -54,25 +64,26 @@ jobs:
run: go mod verify

- name: Go Generate
if: ${{ !inputs.skipGenerate }}
run: go generate ./... && git diff --exit-code

- name: Go Build
run: go build -o /dev/null ./...
run: go build -o=/dev/null -tags=${{ inputs.buildTags }} ./...

- name: Go Vet
run: go vet ./...

- name: Go Compile Tests
if: ${{ inputs.skipTests }}
run: go test -exec /bin/true ./...
run: go test -exec=/bin/true -tags=${{ inputs.buildTags }} ./...

- name: Go Test
if: ${{ !inputs.skipTests }}
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./...
run: go test -v -shuffle=on -tags=${{ inputs.buildTags }} -race -count=1 -coverprofile=coverage.txt ./...

- name: Go Benchmark
if: ${{ !inputs.skipTests }}
run: go test -v -shuffle=on -run=^$ -bench=. -benchtime=1x ./...
run: go test -v -shuffle=on -tags=${{ inputs.buildTags }} -run=^$ -bench=. -benchtime=1x ./...

- name: Upload Coverage
if: ${{ !inputs.skipTests }}
Expand Down

0 comments on commit d2abbfe

Please sign in to comment.