mirror of
https://github.com/lukaszraczylo/shared-actions.git
synced 2026-06-13 02:51:47 +00:00
Add pull request workflow.
This commit is contained in:
@@ -7,7 +7,7 @@ on:
|
|||||||
description: "Go version to use"
|
description: "Go version to use"
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: ">=1.21"
|
default: ">=1.24"
|
||||||
release-workflow:
|
release-workflow:
|
||||||
description: "Release workflow file to trigger (e.g., release.yml)"
|
description: "Release workflow file to trigger (e.g., release.yml)"
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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 ./...
|
||||||
Reference in New Issue
Block a user