From 9dec53f588cde1b6a86c09b6f2155a63dc417316 Mon Sep 17 00:00:00 2001 From: itsdevbear Date: Wed, 7 Aug 2024 10:33:09 -0400 Subject: [PATCH] bet --- .gitignore | 47 +++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..23c4b24 --- /dev/null +++ b/.gitignore @@ -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/ \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..806db57 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +# Makefile for ssz project + +# Go parameters +GOCMD=go +GOBUILD=$(GOCMD) build +GOCLEAN=$(GOCMD) clean +GOTEST=$(GOCMD) test +GOGET=$(GOCMD) get +GOMOD=$(GOCMD) mod +BINARY_NAME=ssz + +# Git parameters +GITCMD=git + +# Build targets +all: test build + +test: + @if [ -z "$(shell ls -A tests/testdata/consensus-spec-tests)" ]; then \ + echo "Consensus spec tests directory is empty. Running setup..."; \ + $(MAKE) setup; \ + fi + + $(GOTEST) -v ./... + +tidy: + $(GOMOD) tidy + +# Generate code (as seen in the GitHub Actions workflow) +generate: + $(GOCMD) generate ./... + +# Coverage (as seen in the GitHub Actions workflow) +coverage: + $(GOTEST) -v -coverprofile=coverage.txt -coverpkg=./... ./... + +setup: + @mkdir -p coverage + @echo "Downloading consensus tests... This may take a while due to the large repository size." + @$(GITCMD) submodule update --init --recursive --depth=1 + @echo "Consensus tests download completed." + +# Phony targets +.PHONY: all build test clean run deps tidy generate coverage submodules