Skip to content
Merged
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
50 changes: 50 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Code Quality

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
code-quality:
name: Code Quality Checks
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true

- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

- name: Check formatting
run: |
# Run gofmt to format code
make fmt

# Check if any files were modified
if [ -n "$(git status --porcelain)" ]; then
echo "❌ Code formatting issues detected. Please run 'make fmt' locally and commit the changes."
echo ""
echo "Files that need formatting:"
git status --porcelain
echo ""
echo "Differences:"
git diff
exit 1
fi
echo "✅ All files are properly formatted"

- name: Run go vet
run: make vet

- name: Run golangci-lint
run: make lint
Loading