fixed https://git.miaurizius.de/MiauRizius/MiauInv/issues/10 #11

Merged
MiauRizius merged 1 commits from chore/10-workflow-optimization into main 2026-06-10 02:00:22 +02:00

View File

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