Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
johnletey committed May 3, 2024
0 parents commit 3efce91
Show file tree
Hide file tree
Showing 46 changed files with 10,131 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h1 style="text-align: center">Noble's Authority Module</h1>

[![codecov](https://img.shields.io/codecov/c/gh/noble-assets/authority?token=QNKNK03VIR&labelColor=black)](https://codecov.io/gh/noble-assets/authority)

This repository includes the `x/authority` Cosmos SDK module implementation.
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parsers:
go:
partials_as_hits: true
25 changes: 25 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Unit Tests

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Run Tests
run: make test-unit

- name: Upload Coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
coverage.out
57 changes: 57 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.PHONY: proto-format proto-lint proto-gen format lint test-unit
all: proto-all format lint test

###############################################################################
### Formatting & Linting ###
###############################################################################

gofumpt_cmd=mvdan.cc/gofumpt
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint

format:
@echo "πŸ€– Running formatter..."
@go run $(gofumpt_cmd) -l -w .
@echo "βœ… Completed formatting!"

lint:
@echo "πŸ€– Running linter..."
@go run $(golangci_lint_cmd) run --timeout=10m
@echo "βœ… Completed linting!"

###############################################################################
### Protobuf ###
###############################################################################

BUF_VERSION=1.31.0
BUILDER_VERSION=0.14.0

proto-all: proto-format proto-lint proto-gen

proto-format:
@echo "πŸ€– Running protobuf formatter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) format --diff --write
@echo "βœ… Completed protobuf formatting!"

proto-gen:
@echo "πŸ€– Generating code from protobuf..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
ghcr.io/cosmos/proto-builder:$(BUILDER_VERSION) sh ./proto/generate.sh
@echo "βœ… Completed code generation!"

proto-lint:
@echo "πŸ€– Running protobuf linter..."
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \
bufbuild/buf:$(BUF_VERSION) lint
@echo "βœ… Completed protobuf linting!"

###############################################################################
### Testing ###
###############################################################################

test: test-unit

test-unit:
@echo "πŸ€– Running unit tests..."
@go test -cover -coverprofile=coverage.out -race -v ./x/authority/keeper/...
@echo "βœ… Completed unit tests!"
Loading

0 comments on commit 3efce91

Please sign in to comment.