-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7f5928e
Showing
20 changed files
with
2,441 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
parsers: | ||
go: | ||
partials_as_hits: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v* | ||
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.21' | ||
|
||
- name: Run Tests | ||
run: make test-unit | ||
|
||
- name: Upload Coverage | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.PHONY: proto-format proto-lint proto-gen format lint test-unit | ||
all: proto-all format lint test-unit | ||
|
||
############################################################################### | ||
### 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.32 | ||
|
||
proto-all: proto-format proto-lint proto-gen | ||
|
||
proto-format: | ||
@echo "🤖 Running protobuf formatter..." | ||
@cd proto | ||
@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 \ | ||
adr36-proto sh ./proto/generate.sh | ||
@echo "✅ Completed code generation!" | ||
|
||
proto-lint: | ||
@echo "🤖 Running protobuf linter..." | ||
@cd proto | ||
@docker run --rm --volume "$(PWD)":/workspace --workdir /workspace \ | ||
bufbuild/buf:$(BUF_VERSION) lint | ||
@echo "✅ Completed protobuf linting!" | ||
|
||
proto-setup: | ||
@echo "🤖 Setting up protobuf environment..." | ||
@docker build --rm --tag adr36-proto:latest --file proto/Dockerfile . | ||
@echo "✅ Setup protobuf environment!" | ||
|
||
############################################################################### | ||
### Testing ### | ||
############################################################################### | ||
|
||
test-unit: | ||
@echo "🤖 Running unit tests..." | ||
@go test -cover -coverprofile=coverage.out -race -v . | ||
@echo "✅ Completed unit tests!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: v1 | ||
plugins: | ||
- name: gocosmos | ||
out: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Generated by buf. DO NOT EDIT. | ||
version: v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: v2 | ||
modules: | ||
- path: proto | ||
lint: | ||
except: | ||
- PACKAGE_VERSION_SUFFIX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
adr36.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>adr36.dev</title> | ||
<meta name="go-import" content="adr36.dev git https://github.com/noble-assets/adr36"> | ||
<meta name="go-source" content="adr36.dev https://github.com/noble-assets/adr36 https://github.com/noble-assets/adr36/tree/main{/dir} https://github.com/noble-assets/adr36/blob/main{/dir}/{file}#L{line}"> | ||
<style> | ||
* { font-family: sans-serif; } | ||
body { margin-top: 0; } | ||
.content { display: inline-block; } | ||
code { display: block; font-family: monospace; font-size: 1em; background-color: #d5d5d5; padding: 1em; margin-bottom: 16px; } | ||
ul { margin-top: 16px; margin-bottom: 16px; } | ||
</style> | ||
</head> | ||
<body> | ||
<div class="content"> | ||
<h2>adr36.dev</h2> | ||
<code>go get adr36.dev</code> | ||
<code>import "adr36.dev"</code> | ||
Home: <a href="https://pkg.go.dev/adr36.dev">https://pkg.go.dev/adr36.dev</a><br/> | ||
Source: <a href="https://github.com/noble-assets/adr36">https://github.com/noble-assets/adr36</a><br/> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.