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
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,18 @@ jobs:
run: make tools

# Run golangci-lint via Makefile for consistency
# Uses incremental linting on PRs for faster CI (50-75% speedup)
- name: Run golangci-lint
run: |
export PATH="$PATH:$(go env GOPATH)/bin"
make golint
if [ "${{ github.event_name }}" = "pull_request" ]; then
# Incremental linting on PRs - only check changed files
# This provides 50-75% faster linting on typical PRs
make golint-incremental BASE_REF=origin/${{ github.base_ref }}
else
# Full scan on main branch to ensure comprehensive coverage
make golint
fi

# Error message linting (requires Go only)
- name: Lint error messages
Expand Down
20 changes: 19 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ download-github-actions-schema:
@cd pkg/workflow/js && npm run format:schema >/dev/null 2>&1
@echo "✓ Downloaded and formatted GitHub Actions schema to pkg/workflow/schemas/github-workflow.json"

# Run linter
# Run linter (full repository scan)
.PHONY: golint
golint:
@if command -v golangci-lint >/dev/null 2>&1; then \
Expand All @@ -311,6 +311,22 @@ golint:
exit 1; \
fi

# Run incremental linter (only changed files since BASE_REF)
# This provides 50-75% faster linting on PRs by only checking changed files
# Usage: make golint-incremental BASE_REF=origin/main
.PHONY: golint-incremental
golint-incremental:
@if ! command -v golangci-lint >/dev/null 2>&1; then \
echo "golangci-lint is not installed. Run 'make deps-dev' to install dependencies."; \
exit 1; \
fi
@if [ -z "$(BASE_REF)" ]; then \
echo "Error: BASE_REF not set. Use: make golint-incremental BASE_REF=origin/main"; \
exit 1; \
fi
@echo "Running incremental lint against $(BASE_REF)..."
golangci-lint run --new-from-rev=$(BASE_REF)

# Validate compiled workflow lock files (models: read not supported yet)
.PHONY: validate-workflows
validate-workflows:
Expand Down Expand Up @@ -530,6 +546,8 @@ help:
@echo " deps - Install dependencies"
@echo " deps-dev - Install development dependencies (includes tools)"
@echo " check-node-version - Check Node.js version (20 or higher required)"
@echo " golint - Run golangci-lint (full repository scan)"
@echo " golint-incremental - Run golangci-lint incrementally (only changed files, requires BASE_REF)"
@echo " lint - Run linter"
@echo " fmt - Format code"
@echo " fmt-cjs - Format JavaScript (.cjs and .js) and JSON files in pkg/workflow/js"
Expand Down