Skip to content

Commit 9773ea6

Browse files
authored
Merge pull request #243 from DecentralCardGame/242-cosmos-v50
242 cosmos v50
2 parents 3d85d97 + 3c628ce commit 9773ea6

File tree

735 files changed

+153650
-112293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

735 files changed

+153650
-112293
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[*.proto]
2+
indent_style = space
3+
trim_trailing_whitespace = false
4+
indent_size = 2
5+
tab_width = 2

.github/workflows/release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# This type of prelease is useful to make your bleeding-edge binaries available to advanced users.
1212
#
13-
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
13+
# The workflow will not run if there is no tag pushed with a "v" prefix and no change pushed to your
1414
# default branch.
1515
on: push
1616

@@ -22,19 +22,21 @@ jobs:
2222
uses: actions/checkout@v2
2323
with:
2424
fetch-depth: 0
25-
26-
- name: Prepare Release Variables
25+
26+
- name: Prepare Release Variables
2727
id: vars
28-
uses: ignite/cli/actions/release/vars@v0.26.1
28+
uses: ignite/cli/actions/release/vars@main
2929

30-
- name: Issue Release Assets
31-
uses: ignite/cli/actions/cli@v0.26.1
30+
- name: Issue Release Assets
31+
uses: ignite/cli/actions/cli@main
3232
if: ${{ steps.vars.outputs.should_release == 'true' }}
3333
with:
34-
args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 --yes
34+
args: chain build --release --release.prefix ${{ steps.vars.outputs.tarball_prefix }} -t linux:amd64 -t darwin:amd64 -t darwin:arm64 -y
35+
env:
36+
DO_NOT_TRACK: 1
3537

3638
- name: Delete the "latest" Release
37-
uses: dev-drprasad/[email protected]
39+
uses: dev-drprasad/[email protected]
3840
if: ${{ steps.vars.outputs.is_release_type_latest == 'true' }}
3941
with:
4042
tag_name: ${{ steps.vars.outputs.tag_name }}
@@ -48,6 +50,6 @@ jobs:
4850
with:
4951
tag_name: ${{ steps.vars.outputs.tag_name }}
5052
files: release/*
51-
prerelease: true
53+
prerelease: true
5254
env:
5355
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
/backup
21
vue/node_modules
32
vue/dist
4-
/vue
53
release/
64
.idea/
75
.vscode/
86
.DS_Store
7+
*.dot
8+
*.log
9+
*.ign
10+
/vue
11+
/goat/node_modules
912
/build
1013
/cs
1114
/goat/node_modules

Makefile

Lines changed: 100 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,109 @@
1-
###############################################################################
2-
### Build ###
3-
###############################################################################
1+
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
2+
COMMIT := $(shell git log -1 --format='%H')
3+
APPNAME := cardchain
44

5-
# Default target
6-
all: install
5+
# don't override user values
6+
ifeq (,$(VERSION))
7+
VERSION := $(shell git describe --exact-match 2>/dev/null)
8+
# if VERSION is empty, then populate it with branch's name and raw commit hash
9+
ifeq (,$(VERSION))
10+
VERSION := $(BRANCH)-$(COMMIT)
11+
endif
12+
endif
13+
14+
# Update the ldflags with the app, client & server names
15+
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(APPNAME) \
16+
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APPNAME)d \
17+
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
18+
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
19+
20+
BUILD_FLAGS := -ldflags '$(ldflags)'
21+
22+
##############
23+
### Test ###
24+
##############
25+
26+
test-unit:
27+
@echo Running unit tests...
28+
@go test -mod=readonly -v -timeout 30m ./...
29+
30+
test-race:
31+
@echo Running unit tests with race condition reporting...
32+
@go test -mod=readonly -v -race -timeout 30m ./...
733

8-
# Build directory
9-
BUILDDIR := ./build
34+
test-cover:
35+
@echo Running unit tests and creating coverage report...
36+
@go test -mod=readonly -v -timeout 30m -coverprofile=$(COVER_FILE) -covermode=atomic ./...
37+
@go tool cover -html=$(COVER_FILE) -o $(COVER_HTML_FILE)
38+
@rm $(COVER_FILE)
1039

11-
# Build the project
12-
build: go.sum $(BUILDDIR)/
13-
@echo "Warning: Building without version information"
14-
@echo "Warning: To build with version info and defaults please use './ignite chain build'"
15-
go build -tags=ledger -mod=readonly -o $(BUILDDIR)/ ./...
40+
bench:
41+
@echo Running unit tests with benchmarking...
42+
@go test -mod=readonly -v -timeout 30m -bench=. ./...
1643

17-
# Create the build directory
18-
$(BUILDDIR)/:
19-
mkdir -p $(BUILDDIR)/
44+
test: govet govulncheck test-unit
2045

21-
# Install binary to ~/go/bin/
22-
install: build
23-
cp $(BUILDDIR)/cardchaind ~/go/bin/
46+
.PHONY: test test-unit test-race test-cover bench
2447

25-
# Verify dependencies
26-
go.sum: go.mod
27-
@echo "Ensure dependencies have not been modified ..." >&2
48+
#################
49+
### Install ###
50+
#################
51+
52+
all: install
53+
54+
install:
55+
@echo "--> ensure dependencies have not been modified"
2856
@go mod verify
57+
@echo "--> installing $(APPNAME)d"
58+
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/$(APPNAME)d
59+
60+
.PHONY: all install
61+
62+
##################
63+
### Protobuf ###
64+
##################
65+
66+
# Use this proto-image if you do not want to use Ignite for generating proto files
67+
protoVer=0.15.1
68+
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
69+
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
70+
71+
proto-gen:
72+
@echo "Generating protobuf files..."
73+
@ignite generate proto-go --yes
74+
75+
.PHONY: proto-gen
76+
77+
#################
78+
### Linting ###
79+
#################
80+
81+
golangci_lint_cmd=golangci-lint
82+
golangci_version=v1.61.0
83+
84+
lint:
85+
@echo "--> Running linter"
86+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
87+
@$(golangci_lint_cmd) run ./... --timeout 15m
88+
89+
lint-fix:
90+
@echo "--> Running linter and fixing issues"
91+
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
92+
@$(golangci_lint_cmd) run ./... --fix --timeout 15m
93+
94+
.PHONY: lint lint-fix
95+
96+
###################
97+
### Development ###
98+
###################
99+
100+
govet:
101+
@echo Running go vet...
102+
@go vet ./...
29103

30-
# Clean build directory
31-
clean:
32-
rm -rf $(BUILDDIR)/
104+
govulncheck:
105+
@echo Running govulncheck...
106+
@go install golang.org/x/vuln/cmd/govulncheck@latest
107+
@govulncheck ./...
33108

34-
# Phony targets
35-
.PHONY: all build install clean
109+
.PHONY: govet govulncheck

0 commit comments

Comments
 (0)