6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 09:51:46 +00:00

Rename master to main, add makefile for running common commands

This commit is contained in:
Grzegorz Dlugoszewski
2025-08-25 20:45:29 +02:00
parent 891bb53e15
commit 6b0a047455
3 changed files with 43 additions and 3 deletions

View File

@@ -2,9 +2,9 @@ name: CI
on:
push:
branches: [master, main]
branches: [main]
pull_request:
branches: [master, main]
branches: [main]
workflow_call:
permissions:

40
Makefile Normal file
View File

@@ -0,0 +1,40 @@
.PHONY: build test fmt lint clean all help
# Default target
all: fmt lint build test
# Build the binary
build:
@echo "Building git-get..."
go build -o git-get ./cmd/
# Run tests with race detection
test:
@echo "Running tests..."
go test -race ./...
# Format code
fmt:
@echo "Formatting code..."
go fmt ./...
# Run linter with auto-fix
lint:
@echo "Running linter..."
golangci-lint run --fix
# Clean built binaries
clean:
@echo "Cleaning..."
rm -f git-get
# Show help
help:
@echo "Available targets:"
@echo " build - Build the git-get binary"
@echo " test - Run tests with race detection"
@echo " fmt - Format Go code"
@echo " lint - Run golangci-lint with auto-fix"
@echo " clean - Remove built binaries"
@echo " all - Run fmt, lint, build, and test (default)"
@echo " help - Show this help message"

View File

@@ -3,7 +3,7 @@
[![build](https://github.com/grdl/git-get/workflows/build/badge.svg)](https://github.com/grdl/git-get/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/grdl/git-get)](https://goreportcard.com/report/github.com/grdl/git-get)
[![Latest Release](https://img.shields.io/github/v/release/grdl/git-get)](https://github.com/grdl/git-get/releases/latest)
[![Go Version](https://img.shields.io/github/go-mod/go-version/grdl/git-get)](https://github.com/grdl/git-get/blob/master/go.mod)
[![Go Version](https://img.shields.io/github/go-mod/go-version/grdl/git-get)](https://github.com/grdl/git-get/blob/main/go.mod)
[![License](https://img.shields.io/github/license/grdl/git-get)](LICENSE.md)
A tool to clone, organize, and manage multiple Git repositories with an automatic directory structure based on repository URLs.