diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c404f1a..44723f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} @@ -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 }}