Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 15 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,23 @@ permissions:
actions: write

jobs:
# lint:
# name: Lint
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: '1.25.1'
# cache: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

# - name: Run go vet
# run: go vet ./...
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.1'
cache: true

# - name: Run golangci-lint
# uses: golangci/golangci-lint-action@v7
# with:
# version: v2.4.0
# args: --timeout=5m
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.7.2

test:
name: Unit Test
Expand All @@ -54,9 +50,6 @@ jobs:
- name: Download dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Run tests
run: go test -short -v -race -coverprofile=coverage.out -covermode=atomic ./...

Expand Down
19 changes: 19 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# golangci-lint v2 configuration
# Reference: https://github.com/golangci/golangci-lint/blob/main/.golangci.reference.yml

version: "2"

linters:
# 기본 린터 세트 사용 (errcheck, govet, ineffassign, staticcheck, unused)
default: standard

formatters:
enable:
- goimports # import 정리 및 포맷팅

run:
# 타임아웃 설정
timeout: 5m

# 테스트 파일 포함
tests: true
122 changes: 0 additions & 122 deletions AGENTS.md

This file was deleted.

89 changes: 14 additions & 75 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# symphonyclient integration: Added CSS build targets
.PHONY: build test install clean fmt lint tidy help build-all setup coverage-check build-css install-css watch-css
.PHONY: build build-all test unit-test clean fmt lint tidy setup run help

BINARY_NAME=sym
BUILD_DIR=bin
Expand All @@ -9,116 +8,56 @@ LDFLAGS=-ldflags "-X main.Version=$(VERSION)"

help:
@echo "Available targets:"
@echo " build - Build the binary for current platform (includes CSS)"
@echo " build - Build the binary for current platform"
@echo " build-all - Build for all platforms (Linux, macOS, Windows)"
@echo " build-css - Build Tailwind CSS for dashboard"
@echo " watch-css - Watch and rebuild CSS on changes"
@echo " test - Run tests"
@echo " install - Install the binary to GOPATH/bin"
@echo " test - Run tests with coverage"
@echo " unit-test - Run tests without coverage"
@echo " clean - Remove build artifacts"
@echo " fmt - Format code"
@echo " lint - Run linter"
@echo " tidy - Tidy dependencies"
@echo " setup - Setup development environment"
@echo " run - Run the application"

# symphonyclient integration: CSS build for dashboard
install-css:
@echo "Installing CSS dependencies..."
@npm install

build-css: install-css
@echo "Building Tailwind CSS..."
@npm run build:css
@echo "CSS build complete"

watch-css: install-css
@echo "Watching CSS changes..."
@npm run watch:css

build: build-css
@echo "Building $(BINARY_NAME)..."
build:
@mkdir -p $(BUILD_DIR)
ifeq ($(OS),Windows_NT)
@go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME).exe $(MAIN_PATH)
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME).exe"
else
@go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) $(MAIN_PATH)
@echo "Build complete: $(BUILD_DIR)/$(BINARY_NAME)"
endif

build-all: build-css
@echo "Building for all platforms..."
build-all:
@mkdir -p $(BUILD_DIR)
@echo "Building Linux amd64..."
@GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-amd64 $(MAIN_PATH)
@echo "Building Linux arm64..."
@GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-linux-arm64 $(MAIN_PATH)
@echo "Building macOS amd64..."
@GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-amd64 $(MAIN_PATH)
@echo "Building macOS arm64..."
@GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-darwin-arm64 $(MAIN_PATH)
@echo "Building Windows amd64..."
@GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME)-windows-amd64.exe $(MAIN_PATH)
@echo "All platform builds complete"

test:
@echo "Running tests..."
@go test -v -race -coverprofile=coverage.out ./...
@go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
@go tool cover -html=coverage.out -o coverage.html
@echo "Test complete. Coverage report: coverage.html"

coverage-check:
@echo "Checking coverage threshold..."
@go test -coverprofile=coverage.out ./... > /dev/null 2>&1
@COVERAGE=$$(go tool cover -func=coverage.out | grep total | awk '{print $$3}' | sed 's/%//'); \
THRESHOLD=80; \
echo "Current coverage: $$COVERAGE%"; \
echo "Required threshold: $$THRESHOLD%"; \
if [ "$$(echo "$$COVERAGE < $$THRESHOLD" | bc -l 2>/dev/null || awk "BEGIN {print ($$COVERAGE < $$THRESHOLD)}")" -eq 1 ]; then \
echo "❌ Coverage $$COVERAGE% is below threshold $$THRESHOLD%"; \
exit 1; \
else \
echo "✅ Coverage $$COVERAGE% meets threshold $$THRESHOLD%"; \
fi

install:
@echo "Installing $(BINARY_NAME)..."
@go install $(MAIN_PATH)
@echo "Install complete"
unit-test:
@go test -short ./...

clean:
@echo "Cleaning..."
@rm -rf $(BUILD_DIR)
@rm -f coverage.out coverage.html
@rm -rf node_modules
@echo "Clean complete"

fmt:
@echo "Formatting code..."
@go fmt ./...
@echo "Format complete"
@golangci-lint fmt

lint:
@echo "Running linter..."
golangci-lint run
@echo "Linter complete"
@golangci-lint run

tidy:
@echo "Tidying dependencies..."
@go mod tidy
@echo "Tidy complete"

# Development helpers
setup: tidy install-css
@echo "Setting up development environment..."
setup:
@go mod download
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0
@echo "Development environment setup complete"

dev-deps:
@echo "Installing development dependencies..."
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
@echo "Development dependencies installed"
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2

run:
@go run $(MAIN_PATH) $(ARGS)
Loading