49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
name: Static Analysis -- Golang
|
|
run-name: 'Static Analysis -- Golang -- ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}'
|
|
on:
|
|
push:
|
|
branches:
|
|
- '*'
|
|
paths:
|
|
- '**/*.go'
|
|
|
|
jobs:
|
|
static-go:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check Out Repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Initialize Runner
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
|
|
- name: Check and Run `make workflow-init`
|
|
run: |
|
|
if make -n workflow-init > /dev/null 2>&1; then
|
|
make workflow-init
|
|
fi
|
|
|
|
- name: Initialize Go
|
|
run: |
|
|
go get .
|
|
GOTOOLCHAIN=local go install honnef.co/go/tools/cmd/staticcheck@latest
|
|
|
|
- name: Run Go Vet
|
|
id: static-go-vet
|
|
if: always()
|
|
run: go vet ./...
|
|
|
|
- name: Run Go Staticcheck
|
|
id: static-go-staticcheck
|
|
if: always()
|
|
run: staticcheck ./...
|
|
|
|
- name: Verify Static Analysis
|
|
if: >
|
|
steps.static-go-vet.outcome != 'success' ||
|
|
steps.static-go-staticcheck.outcome != 'success'
|
|
run: exit 1 |