Skip to content

feat: minimal image

feat: minimal image #7

Workflow file for this run

name: Go Lint and Quality Checks
on:
push:
branches: [ main, master ]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.golangci.yml'
- '.github/workflows/go-lint.yml'
pull_request:
branches: [ main, master ]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.golangci.yml'
- '.github/workflows/go-lint.yml'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout=5m --config=.golangci.yml
skip-cache: false
skip-pkg-cache: false
skip-build-cache: false
fmt-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Check Go formatting
run: |
if [ -n "$(gofmt -s -l .)" ]; then
echo "Go code is not formatted. Please run 'make fmt'"
gofmt -s -d .
exit 1
fi
- name: Check Go imports
run: |
go install golang.org/x/tools/cmd/goimports@latest
if [ -n "$(goimports -l .)" ]; then
echo "Go imports are not organized. Please run 'make fmt'"
goimports -d .
exit 1
fi
vet:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run go vet
run: go vet ./...
security:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: Run gosec Security Scanner
uses: securego/gosec@master
with:
args: '-exclude=G307,G204,G304 ./...'