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

[WIP] [CI:DOCS] GHA: Add staticcheck workflow #4892

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/staticcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---

name: "Golang Static Check"

on: ["push", "pull_request"]

permissions: "read-all"

jobs:
static_check:
name: "Golang Static Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
# Ref: https://github.com/WillAbides/setup-go-faster
- uses: WillAbides/setup-go-faster@v1.7.0
with:
go-version: "*"
# Ignore whatever was already installed on the system
ignore-local: "true"
# Lookup minimum version, don't make suggestions for go versions older than it.
- id: gomod
run: |
printf "version=%s" $(grep -E -m 1 '^go' go.mod | awk '{print $2}') >> $GITHUB_OUTPUT
tail -1 $GITHUB_OUTPUT
# Ref: https://staticcheck.dev/docs/running-staticcheck/ci/github-actions/
# N/B: The staticcheck tool requires golang 1.19+
- uses: dominikh/staticcheck-action@v1.2.0
with:
# Golang was already installed (above)
install-go: "false"
# Renovate manages this value, manual changes are permitted if required.
version: "2023.1.3"
min-go-version: "${{ steps.gomod.outputs.version }}"
Loading