Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tools): add basic makefile, to prevent confusion on how to setup tests #21

Closed
wants to merge 4 commits into from
Closed
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
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
vendor/

# Go workspace file
go.work

# IDE-specific files
.idea/
.vscode/

# OS-specific files
.DS_Store
Thumbs.db

# Log files
*.log

# Binary output directory
/bin/

# Environment variables file
.env

# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a

# Debug files
debug

# Coverage files
coverage.txt
coverage-*.txt
coverage/
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Makefile for ssz project

default: all

all: setup build test

build: check_consensus_tests
@echo "Building project..."
@go build -v ./...

test: check_consensus_tests
@echo "Running tests..."
@go test ./...

tidy:
@echo "Tidying go modules..."
@go mod tidy

generate:
@echo "Generating code..."
@go generate ./...

setup:
@mkdir -p coverage
@echo "Downloading consensus tests... This may take a while due to the large repository size."
@git submodule update --init --recursive --force --depth=1
@echo "Consensus tests download completed."

check_consensus_tests:
@if [ -z "$(shell ls -A tests/testdata/consensus-spec-tests)" ]; then \
echo "Consensus spec tests directory is empty. Running setup..."; \
$(MAKE) setup; \
fi

# Phony targets
.PHONY: all build coverage test tidy generate setup check_consensus_tests