Skip to content

Commit

Permalink
Merge branch 'master' into feat/extract-tm2-depencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton committed Dec 21, 2023
2 parents 68dc091 + 29fd2ea commit 243b1f1
Show file tree
Hide file tree
Showing 145 changed files with 4,913 additions and 1,351 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.gno linguist-language=Go
*.pb.go linguist-generated merge=ours -diff
go.sum linguist-generated text
gnovm/stdlibs/native.go linguist-generated
gnovm/tests/stdlibs/native.go linguist-generated
8 changes: 2 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
# Primary repo maintainers.
* @gnolang/tech-staff


# Tendermint2 (Gno version).
tm2/* @gnolang/tech-staff
tm2/pkg @jaekwon @moul
# TODO: add per package exceptions


# Docs & Content.
docs/ @gnolang/tech-staff
*.md @gnolang/tech-staff
docs/ @gnolang/devrels @gnolang/tech-staff
misc/docusaurus/ @gnolang/devrels @gnolang/tech-staff
# TODO: add non-tech people here.


Expand All @@ -37,6 +36,3 @@ PHILOSOPHY.md @jaekwon @moul
CONTRIBUTING.md @jaekwon @moul
LICENSE.md @jaekwon @moul
.github/CODEOWNERS @jaekwon @moul

# Documentation.
docs/* @gnolang/devrels
3 changes: 3 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ flag_management:
- name: gno.land
paths:
- gno.land
- name: misc
paths:
- misc
36 changes: 36 additions & 0 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: code generation

on:
push:
branches: [ "master" ]
pull_request:
paths:
- 'gnovm/stdlibs/**'
- 'gnovm/tests/stdlibs/**'
- 'misc/genstd'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
generated:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Checkout code
uses: actions/checkout@v4

- name: Check generated files are up to date
run: |
go generate -x ./...
if [ "$(git status -s)" != "" ]; then
echo "command 'go generate' creates file that differ from git tree, please run 'go generate' and commit:"
git status -s
exit 1
fi
41 changes: 41 additions & 0 deletions .github/workflows/dependabot-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Dependabot Tidy Go Mods

on:
pull_request:
paths:
- '.github/workflows/**'
- '**/go.mod'
- '**/go.sum'

jobs:
tidy_go_mods:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Tidy all Go mods
run: |
set -e
# Find all go.mod files
gomods=$(find . -type f -name go.mod)
# Tidy each go.mod file
for modfile in $gomods; do
dir=$(dirname "$modfile")
# Run go mod tidy in the directory
(cd "$dir" && go mod tidy -v) || exit 1
done
- name: Commit changes, if any
uses: stefanzweifel/git-auto-commit-action@v5
with:
skip_dirty_check: false # Enable dirty check, and skip unnecessary committing
commit_message: "Run 'go mod tidy' via GitHub Actions"
91 changes: 91 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: lint

on:
push:
branches: [ "master" ]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

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

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
# sync with misc/devdeps/go.mod
version: v1.54
args:
--config=./.github/golangci.yml
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Install make
run: sudo apt-get install -y make

# prefill dependencies so that mod messages don't show up in make output
- name: Fetch dependencies
run: go mod download -modfile ./misc/devdeps/go.mod -x

# inspired by:
# https://github.com/Jerome1337/gofmt-action/blob/d5eabd189843f1d568286a54578159978b7c0fb1/entrypoint.sh
- name: Check gofumpt
run: |
output="$(GOFMT_FLAGS=-l make -s fmt)"
if [ ! -z "$output" ]; then
echo "The following files are not properly formatted; run 'make fmt' to format them."
echo "$output"
exit 1
else
echo 'Succeeded.'
fi
mod_tidy_check:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Check go.mods
run: |
set -xe
# Find all go.mod files
gomods=$(find . -type f -name go.mod)
# Calculate sums for all go.mod files
sums=$(sha256sum $gomods)
# Iterate over each go.mod file
for modfile in $gomods; do
dir=$(dirname "$modfile")
# Run go mod tidy in the directory
(cd "$dir" && go mod tidy -v) || exit 1
done
# Verify the sums
echo "$sums" | sha256sum -c
110 changes: 50 additions & 60 deletions .github/workflows/misc.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,80 @@
# tests the "misc" directory & tools
# (not meant for miscellaneous workflows)
name: misc

on:
pull_request:
paths:
- "misc/genstd/**.go"
- "misc/Makefile"
- ".github/workflows/misc.yml"
# Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, misc, and gno.land concurrently.
- "gnovm/**"
- "tm2/**"
- "gno.land/**"
- "examples/**"
- ".github/workflows/**"
push:
branches: [ "master" ]
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
lint:
build:
strategy:
fail-fast: false
matrix:
goversion:
- "1.21.x"
program:
- "genstd"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
# sync with misc/devdeps/go.mod
version: v1.54
args:
--config=./.github/golangci.yml
fmt:
runs-on: ubuntu-latest
steps:
go-version: ${{ matrix.goversion }}
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Install make
run: sudo apt-get install -y make
- name: go install
working-directory: misc
run: go install ./${{ matrix.program }}

# prefill dependencies so that mod messages don't show up in make output
- name: Fetch dependencies
run: go mod download -modfile ./misc/devdeps/go.mod -x

# inspired by:
# https://github.com/Jerome1337/gofmt-action/blob/d5eabd189843f1d568286a54578159978b7c0fb1/entrypoint.sh
- name: Check gofumpt
run: |
output="$(GOFMT_FLAGS=-l make -s fmt)"
if [ ! -z "$output" ]; then
echo "The following files are not properly formatted; run 'make fmt' to format them."
echo "$output"
exit 1
else
echo 'Succeeded.'
fi
modtidy:
test:
strategy:
fail-fast: false
matrix:
goversion:
- "1.21.x"
args:
- _test.genstd
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: ${{ matrix.goversion }}

- name: Check go.mods
- name: Test
working-directory: misc
run: |
set -xe
# Find all go.mod files
gomods=$(find . -type f -name go.mod)
# Calculate sums for all go.mod files
sums=$(sha256sum $gomods)
# Iterate over each go.mod file
for modfile in $gomods; do
dir=$(dirname "$modfile")
# Run go mod tidy in the directory
(cd "$dir" && go mod tidy -v) || exit 1
done
# Verify the sums
echo "$sums" | sha256sum -c
export GOPATH=$HOME/go
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic"
make ${{ matrix.args }}
- if: runner.os == 'Linux'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: misc
flags: misc,misc-${{matrix.args}},go-${{ matrix.goversion }}
files: ./misc/coverage.out
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ test.components:
$(MAKE) --no-print-directory -C gnovm test
$(MAKE) --no-print-directory -C gno.land test
$(MAKE) --no-print-directory -C examples test
$(MAKE) --no-print-directory -C misc test

.PHONY: test.docker
test.docker:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Gno is an interpreted and fully-deterministic implementation of the Go
programming language, designed to build succinct and composable smart contracts.
The first blockchain to use it is Gno.land, a
[Proof of Contribution](./docs/explanation/proof-of-contribution.md)-based chain, backed by
[Proof of Contribution](./docs/concepts/proof-of-contribution.md)-based chain, backed by
a variation of the [Tendermint](https://docs.tendermint.com/v0.34/introduction/what-is-tendermint.html)
consensus engine.

Expand All @@ -20,7 +20,9 @@ consensus engine.
If you haven't already, take a moment to check out our [website](https://gno.land/).

> The website is a deployment of our [gnoweb](./gno.land/cmd/gnoweb) frontend; you
> can use it to check out [some](https://test3.gno.land/r/demo/boards) [example](https://test3.gno.land/r/gnoland/blog)
> can use it to check out
> [some](https://test3.gno.land/r/demo/boards)
> [example](https://test3.gno.land/r/gnoland/blog)
> [contracts](https://test3.gno.land/r/demo/users).
>
> Use the `[source]` button in the header to inspect the program's source; use
Expand All @@ -45,6 +47,7 @@ We look forward to seeing your first PR!
* [gnovm](./gnovm) - GnoVM and Gnolang.
* [gno.land](./gno.land) - Gno.land blockchain and tools.
* [tm2](./tm2) - Tendermint2.
* [contribs](./contribs) - Collection of enhanced tools for Gno.

## Socials & Contact

Expand All @@ -67,7 +70,6 @@ We look forward to seeing your first PR!
* [gnokey](./gno.land/cmd/gnokey) - key manipulation, also general interaction with gnoland
* [gnoland](./gno.land/cmd/gnoland) - runs the blockchain node
* [gnoweb](./gno.land/cmd/gnoweb) - serves gno website, along with user-defined content
* [logos](./misc/logos) - intended to be used as a browser

Developer commands:

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 243b1f1

Please sign in to comment.