Fix CI Go module issue: add vendor generation and GO111MODULE=on
Some checks failed
CI/CD Pipeline / frontend-build (push) Blocked by required conditions
CI/CD Pipeline / e2e-test (push) Blocked by required conditions
CI/CD Pipeline / backend-lint (push) Failing after 32s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / frontend-lint (push) Has been cancelled

- Add GO111MODULE=on to ensure module mode in CI
- Add go mod vendor step to generate vendor directory
- Use -mod=vendor flag for vet and test commands
- Fixes 'package not in std' error in Gitea CI
This commit is contained in:
Damir Mukimov 2025-12-25 16:24:31 +01:00
parent 60848459f3
commit c592757892
No known key found for this signature in database
GPG Key ID: 42996CC7C73BC750

View File

@ -65,17 +65,28 @@ jobs:
- name: Install dependencies
working-directory: bugulma/backend
run: go mod download
env:
GO111MODULE: on
- name: Tidy and verify modules
working-directory: bugulma/backend
run: |
go mod tidy
go mod verify
env:
GO111MODULE: on
- name: Vendor dependencies
working-directory: bugulma/backend
run: go mod vendor
env:
GO111MODULE: on
- name: Vet
working-directory: bugulma/backend
run: go vet ./...
run: go vet -mod=vendor ./...
env:
GO111MODULE: on
- name: Test
working-directory: bugulma/backend
run: go test -v -race -coverprofile=coverage.out ./...
run: go test -v -race -coverprofile=coverage.out -mod=vendor ./...
- name: Coverage
working-directory: bugulma/backend
run: go tool cover -html=coverage.out -o coverage.html