Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gnolang/gno into misc/autocounterd
Browse files Browse the repository at this point in the history
  • Loading branch information
albttx committed Feb 20, 2024
2 parents 743b1c7 + 1c6d184 commit 623dae7
Show file tree
Hide file tree
Showing 119 changed files with 2,893 additions and 1,280 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ updates:
interval: "daily"
labels:
- "github_actions"
groups:
actions:
patterns:
- "*"

# Maintain dependencies for top level Go modules
- package-ecosystem: gomod
Expand Down
13 changes: 1 addition & 12 deletions .github/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ linters-settings:
- opinionated
- performance
- style
gomodguard:
blocked:
modules:
- log/slog:
recommendations:
- golang.org/x/exp
reason: "the minimum go version for the monorepo is 1.20"
versions:
- go.uber.org/zap/exp:
version: "> 0.1.0"
reason: "this version of zap/exp is a requirement until we upgrade to go 1.21 (https://github.com/uber-go/zap/blob/master/exp/CHANGELOG.md)"

issues:
whole-files: true
Expand All @@ -86,4 +75,4 @@ issues:
- goconst # Disabled linting of common mnemonics and test case strings
- path: _\.gno
linters:
- errorlint # Disabled linting of error comparisons, because of lacking std lib support
- errorlint # Disabled linting of error comparisons, because of lacking std lib support
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 1
- uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.22.x"
- name: "gobenchdata publish: ${{ inputs.publish }}"
run: go run go.bobheadxi.dev/gobenchdata@v1 action
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Checkout code
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/contribs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
goversion: # two latest versions
- "1.21.x"
- "1.22.x"
program:
- "gnomd"
- "gnodev"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
tags:
- cleveldb
- memdb
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Tidy all Go mods
env:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -38,8 +38,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -63,8 +63,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
Expand All @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.21.x" ]
go-version: [ "1.22.x" ]
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.22.x"
- run: "cd misc/gendocs && make install gen"
- uses: actions/configure-pages@v4
id: pages
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/gnoland.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
goarch: [ "amd64" ]
goos: [ "linux" ]
program:
- gnoland
- gnokey
- gnoweb
- gnofaucet
- gnotxsync
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand All @@ -54,8 +53,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
args:
- _test.gnoland
- _test.gnokey
Expand Down Expand Up @@ -83,7 +82,7 @@ jobs:
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic"
make ${{ matrix.args }}
- uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.22.x' }}
with:
name: ${{runner.os}}-coverage-gnoland-${{ matrix.args}}-${{matrix.goversion}}
path: ./gno.land/coverage.out
Expand Down Expand Up @@ -116,6 +115,9 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.22.x
# TODO: setup docker caching
- run: make test.docker
- run: docker logs int_gnoland || true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gnovm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
fail-fast: false
matrix:
goversion: # two latest versions
- "1.20.x"
- "1.21.x"
- "1.22.x"
goenv: # TODO: replace with pairs, so it's easier to read in the GH interface.
- "GOARCH=amd64 GOOS=linux"
- "GOARCH=wasm GOOS=js"
Expand All @@ -53,8 +53,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
args:
- _test.cmd
- _test.pkg
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
# Run target test
make ${{ matrix.args }}
- uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.22.x' }}
with:
name: ${{runner.os}}-coverage-gnovm-${{ matrix.args}}-${{matrix.goversion}}
path: ${{ env.COVERAGE_DIR }}
Expand All @@ -122,7 +122,7 @@ jobs:
path: ${{ env.COVERAGE_DATA }}
- uses: actions/setup-go@v4
with:
go-version: "1.21.x"
go-version: "1.22.x"
- name: Merge coverages
working-directory: ${{ env.COVERAGE_DATA }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Lint
uses: golangci/golangci-lint-action@v3
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Install make
run: sudo apt-get install -y make
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Install make
run: sudo apt-get install -y make
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
program:
- "genstd"
runs-on: ubuntu-latest
Expand All @@ -49,7 +49,7 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
args:
- _test.genstd
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tm2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
goarch: [ "amd64" ]
goos: [ "linux" ]
program: [ "./pkg/amino/cmd/aminoscan", "./pkg/amino/cmd/goscan", "./pkg/autofile/cmd", "./pkg/iavl/cmd/iaviewer" ]
Expand All @@ -48,8 +48,8 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.20.x"
- "1.21.x"
- "1.22.x"
args:
- _test.flappy
- _test.pkg.amino
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
make ${{ matrix.args }}
touch coverage.out
- uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.22.x' }}
with:
name: ${{runner.os}}-coverage-tm2-${{ matrix.args}}-${{matrix.goversion}}
path: ./tm2/coverage.out
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ Likewise, if you have an idea on how to improve this guide, go for it as well.

### Environment

The gno repository is primarily based on Golang (Go) and Gnolang (Gno).
The gno repository is primarily based on Go (Golang) and Gno.

The primary tech stack for working on the repository:

- Go (version 1.20+)
- Go (version 1.21+)
- make (for using Makefile configurations)

It is recommended to work on a Unix environment, as most of the tooling is built around ready-made tools in Unix (WSL2
for Windows / Linux / macOS).

For Gno, there is no specific tooling that needs to be installed, that’s not already provided with the repo itself.
You can utilize the `gno` command to facilitate Gnolang support when writing Smart Contracts in Gno, by installing it
You can utilize the `gno` command to facilitate Gno support when writing Smart Contracts in Gno, by installing it
with `make install_gno`.

If you are working on Go source code on this repository, `pkg.go.dev` will not
Expand Down Expand Up @@ -149,16 +149,16 @@ if (executable('gnols'))
else
echomsg 'gnols binary not found: LSP disabled for Gno files'
endif
function! s:on_lsp_buffer_enabled() abort
" Autocompletion
setlocal omnifunc=lsp#complete
" Format on save
autocmd BufWritePre <buffer> LspDocumentFormatSync
" Some optional mappings
nmap <buffer> <leader>i <Plug>(lsp-hover)
nmap <buffer> <leader>i <Plug>(lsp-hover)
" Following mappings are not supported yet by gnols
" nmap <buffer> gd <plug>(lsp-definition)
" nmap <buffer> gd <plug>(lsp-definition)
" nmap <buffer> <leader>rr <plug>(lsp-rename)
endfunction
augroup lsp_install
Expand Down
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build
FROM golang:1.21 AS build
FROM golang:1.22 AS build
RUN mkdir -p /opt/gno/src /opt/build
WORKDIR /opt/build
ADD go.mod go.sum ./
Expand All @@ -10,7 +10,6 @@ RUN go build -o ./build/gnokey ./gno.land/cmd/gnokey
RUN go build -o ./build/gnofaucet ./gno.land/cmd/gnofaucet
RUN go build -o ./build/gnoweb ./gno.land/cmd/gnoweb
RUN go build -o ./build/gno ./gnovm/cmd/gno
RUN go build -o ./build/gnotxsync ./gno.land/cmd/gnotxsync
RUN ls -la ./build
ADD . /opt/gno/src/
RUN rm -rf /opt/gno/src/.git
Expand Down Expand Up @@ -43,10 +42,6 @@ COPY --from=build /opt/build/build/gnofaucet /opt/gno/bin/
ENTRYPOINT ["gnofaucet"]
EXPOSE 5050

FROM runtime-tls AS gnotxsync-slim
COPY --from=build /opt/build/build/gnotxsync /opt/gno/bin/
ENTRYPOINT ["gnotxsync"]

FROM runtime-tls AS gnoweb-slim
COPY --from=build /opt/build/build/gnoweb /opt/gno/bin/
COPY --from=build /opt/gno/src/gno.land/cmd/gnoweb /opt/gno/src/gnoweb
Expand Down
25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
.PHONY: help
help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z][^:]*:' | cut -d: -f1 | sort | sed 's/^/ /'
@cat Makefile | grep '^[a-z][^:]*:' | grep -v 'install_' | cut -d: -f1 | sort | sed 's/^/ /'

rundep=go run -modfile misc/devdeps/go.mod

.PHONY: install
install: install_gnokey install_gno
install: install.gnokey install.gno
@if ! command -v gnodev > /dev/null; then \
echo ------------------------------; \
echo "For local realm development, gnodev is recommended: https://docs.gno.land/gno-tooling/cli/gno-tooling-gnodev"; \
echo "You can install it by calling 'make install.gnodev'"; \
fi

# shortcuts to frequently used commands from sub-components.
install_gnokey:
.PHONY: install.gnokey
install.gnokey:
$(MAKE) --no-print-directory -C ./gno.land install.gnokey
@echo "[+] 'gnokey' is installed. more info in ./gno.land/."
install_gno:
.PHONY: install.gno
install.gno:
$(MAKE) --no-print-directory -C ./gnovm install
@echo "[+] 'gno' is installed. more info in ./gnovm/."
.PHONY: install.gnodev
install.gnodev:
$(MAKE) --no-print-directory -C ./contribs install.gnodev
@echo "[+] 'gnodev' is installed."

# old aliases
.PHONY: install_gnokey
install_gnokey: install.gnokey
.PHONY: install_gno
install_gno: install.gno

.PHONY: test
test: test.components test.docker
Expand Down
Loading

0 comments on commit 623dae7

Please sign in to comment.