Try to fix ci

This commit is contained in:
Arnaud 2025-10-28 07:49:59 +01:00
parent a74ac84124
commit f8b673c008
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F
2 changed files with 16 additions and 7 deletions

View File

@ -41,13 +41,19 @@ jobs:
- name: Generate code (protobuf and mocks)
run: go generate ./...
- name: Fetch Codex library
run: make fetch
- name: Build
run: go build -v ./...
run: make build
- name: Run unit tests
run: gotestsum --packages="./communities" -f standard-verbose --rerun-fails -- -race -v -count=1
run: make test
- name: Run integration tests
run: make test-integration
- name: Check test coverage for communities package
run: |
go test -coverprofile=coverage.out ./communities

View File

@ -24,15 +24,14 @@ fetch:
unzip -o -qq $(LIBS_DIR)/codex-${OS}-${ARCH}.zip -d $(LIBS_DIR)
rm -f $(LIBS_DIR)/*.zip
build:
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN_NAME) main.go
build-upload:
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o bin/codex-upload ./cmd/upload
build-download:
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o bin/codex-download ./cmd/download
build: build-upload build-download
test:
@echo "Running unit tests..."
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test -v ./communities
@ -41,6 +40,10 @@ test-integration:
@echo "Running tests..."
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test -v -tags=codex_integration ./communities -run Integration -timeout 15s
coverage:
@echo "Running unit tests with coverage..."
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test -coverprofile=coverage.out ./communities
clean:
rm -f $(BIN_NAME)
rm -Rf $(LIBS_DIR)/*