Skip to content

Commit

Permalink
update v4 (#470)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMarstonConnell authored Aug 4, 2024
2 parents 70ed29c + 40d9585 commit 964a1ec
Show file tree
Hide file tree
Showing 613 changed files with 22,648 additions and 24,534 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Build CLI
run: go install ./...
16 changes: 8 additions & 8 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ jobs:
matrix:
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Build CLI
shell: bash
run: |
make build
cp "build/canined" "canined-$RUNNER_OS"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: canined-${{runner.os}}
path: canined-${{runner.os}}
Expand All @@ -31,20 +31,20 @@ jobs:
[build-cli]
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].7
- uses: EndBug/latest-tag@latest
with:
# You can change the name of the tag with this input.
# Default: 'latest'
tag-name: canary
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: canined-Linux
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: canined-macOS
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: true
name: Canary
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cloc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected].0
- uses: actions/[email protected].7

# Runs djdefi/cloc-action
- name: Count Lines of Code (cloc)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ jobs:

steps:
- name: Checkout repository
uses: actions/[email protected].0
uses: actions/[email protected].7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: 'go'
queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
8 changes: 4 additions & 4 deletions .github/workflows/cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Get Coverage
run: |
go test ./... -timeout=30m -cover -coverprofile coverage.out
Expand All @@ -30,7 +30,7 @@ jobs:
go tool cover -func coverage3.out
rm coverage2.out
rm coverage.out
- uses: codecov/codecov-action@v3.1.4
- uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV }}

8 changes: 4 additions & 4 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.2
- uses: actions/[email protected].0
go-version: 1.22.2
- uses: actions/[email protected].7
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ jobs:
matrix:
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Build CLI
shell: bash
run: |
make build
cp "build/canined" "canined-$RUNNER_OS"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: canined-${{runner.os}}
path: canined-${{runner.os}}

# MacOS-ARM64-CLI:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/[email protected].0
# - uses: actions/setup-go@v4
# - uses: actions/[email protected].7
# - uses: actions/setup-go@v5
# with:
# go-version: 1.19 # The Go version to download (if necessary) and use.
# - name: Install xgo
Expand All @@ -47,7 +47,7 @@ jobs:
# run: |
# make build_macos_arm64_cli
# cp "canined-macos-arm64" "canined-MacOS-arm64"
# - uses: actions/upload-artifact@v3
# - uses: actions/upload-artifact@v4
# with:
# name: canined-MacOS-arm64
# path: canined-MacOS-arm64
Expand All @@ -57,7 +57,7 @@ jobs:
[native-build-cli]
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected].0
- uses: actions/[email protected].7
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
Expand All @@ -66,14 +66,14 @@ jobs:
shell: bash
run: |
echo "::set-output name=IS_PRE_RELEASE::$(echo "${{ steps.get_version.outputs.VERSION }}" | awk 'BEGIN{prerelease="false"} /beta|alpha/{prerelease="true"} END{print prerelease}')"
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: canined-Linux
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: canined-macOS
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: ${{ steps.is_pre_release.outputs.IS_PRE_RELEASE }}
files: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-full-app-sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
branches: ["master"]

jobs:
test:
name: Test
simtest:
name: Simulation Test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
- name: Test
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Simulation Test
shell: bash
run: make test-sim-full-app
12 changes: 6 additions & 6 deletions .github/workflows/test-import-export-sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
branches: ["master"]

jobs:
test:
name: Test
io-sim:
name: Import Export Sim Test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
- name: Test
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Simulation
shell: bash
run: make test-sim-import-export
6 changes: 3 additions & 3 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].0
- uses: actions/setup-go@v4
- uses: actions/[email protected].7
- uses: actions/setup-go@v5
with:
go-version: 1.20.2 # The Go version to download (if necessary) and use.
go-version: 1.22.2 # The Go version to download (if necessary) and use.
- name: Test
shell: bash
run: make test-unit
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# syntax=docker/dockerfile:1
FROM golang:1.20
FROM golang:1.21

# Update package list and install jq
RUN apt-get update && apt-get install -y jq

WORKDIR /canine-chain
COPY . /canine-chain
RUN ls
RUN go install ./cmd/canined
CMD ["sh", "./scripts/test-node-dev.sh"]
# If the 'modify genesis' function in outpost contract works, might change this back to 'test-node-dev.sh'?
CMD ["sh", "./scripts/devnet-ica.sh"]
EXPOSE 26657
EXPOSE 26656
EXPOSE 26658
Expand Down
53 changes: 28 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))

# Add check to make sure we are using the proper Go version before proceeding with anything
check-go-version:
@if ! go version | grep -q "go1.20"; then \
echo "\033[0;31mERROR:\033[0m Go version 1.20 is required for compiling canined. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version 1.20 and retry. Thank you!"; \
@if ! go version | grep -q "go1.22"; then \
echo "\033[0;31mERROR:\033[0m Go version 1.21 is required for compiling canined. It looks like you are using" "$(shell go version) \nThere are potential consensus-breaking changes that can occur when running binaries compiled with different versions of Go. Please download Go version 1.22 and retry. Thank you!"; \
exit 1; \
fi

Expand Down Expand Up @@ -173,11 +173,11 @@ runsim:
###############################################################################

format-tools:
go install mvdan.cc/gofumpt@v0.5.0
go install mvdan.cc/gofumpt@v0.6.0
gofumpt -l -w .

lint: format-tools
golangci-lint run
golangci-lint run --fix

format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w -s
Expand All @@ -188,42 +188,45 @@ format: format-tools
###############################################################################
### Protobuf ###
###############################################################################
PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:v0.7
PROTO_BUILDER_CONTAINER=jackal-proto-gen
PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto
# thanks juno ;)
protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=jackal-proto-gen-$(protoVer)
containerProtoGenAny=jackal-proto-gen-any-$(protoVer)
containerProtoGenSwagger=jackal-proto-gen-swagger-$(protoVer)
containerProtoFmt=jackal-proto-fmt-$(protoVer)

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

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${PROTO_BUILDER_CONTAINER}$$"; then docker start -a $(PROTO_BUILDER_CONTAINER); else docker run --name $(PROTO_BUILDER_CONTAINER) -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) \
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi

proto-linter:
@echo "Linting Protobuf files"
# @if docker ps -a --format '{{.Names}}' | grep -Eq "^${PROTO_BUILDER_CONTAINER}$$"; then docker start -a $(PROTO_BUILDER_CONTAINER); else docker run --name $(PROTO_BUILDER_CONTAINER) -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) \
# sh ./scripts/protolint.sh; fi
# This generates the SDK's custom wrapper for google.protobuf.Any. It should only be run manually when needed
proto-gen-any:
@echo "Generating Protobuf Any"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenAny}$$"; then docker start -a $(containerProtoGenAny); else docker run --name $(containerProtoGenAny) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen-any.sh; fi

sh ./scripts/protolint.sh
proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGenSwagger}$$"; then docker start -a $(containerProtoGenSwagger); else docker run --name $(containerProtoGenSwagger) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protoc-swagger-gen.sh; fi

proto-format:
# @echo "Formatting Protobuf files"
# $(DOCKER) run --rm -v $(CURDIR):/workspace \
# --workdir /workspace $(PROTO_FORMATTER_IMAGE) \
# find ./ -name *.proto -exec clang-format -i {} \;

sh ./scripts/protoformat.sh


proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi

proto-lint:
@$(DOCKER_BUF) lint proto --error-format=json
@$(DOCKER_BUF) lint --error-format=json

proto-check-breaking:
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=main

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps docs

.PHONY: all install install-debug \
go-mod-cache draw-deps clean build format \
test test-all test-build test-cover test-unit test-race \
Expand Down
Loading

0 comments on commit 964a1ec

Please sign in to comment.