Files
shared-actions/.github/workflows/go-pr.yaml
T

45 lines
910 B
YAML

name: Go Pull Request
on:
workflow_call:
inputs:
go-version:
description: "Go version to use"
required: false
type: string
default: ">=1.24"
jobs:
pr-checks:
name: PR Checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
cache: true
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Run go vet
run: go vet ./...
- name: Run staticcheck
run: staticcheck ./...
- name: Run TruffleHog
uses: trufflesecurity/trufflehog@main
with:
extra_args: --only-verified
- name: Run tests
run: go test -race -cover ./...