30 lines
697 B
YAML
30 lines
697 B
YAML
name: Code Quality and Testing
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, 'feature/**', 'bugfix/**', 'chore/**', 'refactor/**' ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
test-and-lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.22'
|
|
|
|
- name: Check Go Formatting (gofmt)
|
|
run: |
|
|
if [ -n "$(gofmt -l .)" ]; then
|
|
echo "The following files are not properly formatted. Please run 'gofmt -w .'"
|
|
gofmt -l .
|
|
exit 1
|
|
fi
|
|
|
|
- name: Run Unit Tests
|
|
run: go test -v ./... |