Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build tags and skipGenerate #95

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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