From 36ff377ac9872e9d6e595722f61996108ba07ed0 Mon Sep 17 00:00:00 2001 From: miaurizius Date: Wed, 10 Jun 2026 01:57:29 +0200 Subject: [PATCH] fixed https://git.miaurizius.de/MiauRizius/MiauInv/issues/10 --- .gitea/workflows/test-and-lint.yaml | 39 ++++++++++++++++------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/test-and-lint.yaml b/.gitea/workflows/test-and-lint.yaml index 1b81e11..b457491 100644 --- a/.gitea/workflows/test-and-lint.yaml +++ b/.gitea/workflows/test-and-lint.yaml @@ -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 ./... \ No newline at end of file + - 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 ./... \ No newline at end of file