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
68 changes: 68 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-test:
runs-on: ubuntu-latest

strategy:
matrix:
go-version: [1.24.1]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Download dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Install golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-cache: false
skip-pkg-cache: false
skip-build-cache: false

- name: Run linting
run: make lint

- name: Run tests
run: make test

- name: Build binary
run: make build

- name: Test binary execution (help)
run: ./build/seiload --help

- name: Test dry-run with sample config
run: |
./build/seiload --config profiles/local.json --dry-run --workers 1 --stats-interval 1s &
SEILOAD_PID=$!
sleep 5
kill $SEILOAD_PID || true
wait $SEILOAD_PID 2>/dev/null || true
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Build artifacts
build/

# IDE files
.vscode/
*.swp
*.swo
.idea

# OS files
.DS_Store
Thumbs.db

# Go specific
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
go.work
go.work.sum

# Coverage files
coverage.out
coverage.html
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,14 @@ BIN_FILES := $(addprefix $(BUILD_DIR)/, $(addsuffix .bin, $(CONTRACT_NAMES)))
BINDING_FILES := $(addprefix $(BINDINGS_DIR)/, $(addsuffix .go, $(CONTRACT_NAMES)))
SCENARIO_TEMPLATE_FILES := $(addprefix $(SCENARIOS_DIR)/, $(addsuffix .go, $(CONTRACT_NAMES)))

.PHONY: generate clean help build-cli install setup-node
.PHONY: generate clean help build-cli install setup-node build test lint

# Default target
help:
@echo "Available targets:"
@echo " build - Build the seiload CLI (alias for build-cli)"
@echo " test - Run tests with coverage"
@echo " lint - Run linting and static analysis"
@echo " setup-node - Install nvm, Node.js 20, and solc"
@echo " generate - Generate Go bindings and scenario templates for all contracts"
@echo " clean - Remove generated files"
Expand Down Expand Up @@ -132,3 +135,19 @@ install: build-cli
@echo "📦 Installing CLI ..."
@cp $(BUILD_DIR)/$(BINARY_NAME) $(INSTALL_PATH)/$(BINARY_NAME)
@echo "✅ Installed CLI: $(BINARY_NAME)"

# Build the seiload CLI binary (alias for build-cli)
build: build-cli

# Run tests with coverage
test:
@echo "🔍 Running tests with coverage..."
@go test -v -race -coverprofile=coverage.out ./...
@go tool cover -func=coverage.out
@echo "✅ Tests passed"

# Run linting and static analysis
lint:
@echo "🔍 Running linting and static analysis..."
@golangci-lint run
@echo "✅ Linting and static analysis passed"
1 change: 0 additions & 1 deletion build/ERC20.bin

This file was deleted.

1 change: 0 additions & 1 deletion build/ERC20Conflict.bin

This file was deleted.

Loading
Loading