Skip to content

Commit

Permalink
Merge branch 'master' into feat/blog-sort
Browse files Browse the repository at this point in the history
  • Loading branch information
leohhhn authored Jan 9, 2024
2 parents 22305c3 + 568a087 commit 222ef72
Show file tree
Hide file tree
Showing 253 changed files with 8,364 additions and 2,058 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
1 change: 1 addition & 0 deletions .github/workflows/contribs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- "1.21.x"
program:
- "gnomd"
- "gnodev"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
Expand Down
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"
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: mv .github/.fossa.yml .

- name: Cache Coursier cache
uses: coursier/cache-action@v6.4.0
uses: coursier/cache-action@v6.4.4

- name: Set up JDK 17
uses: coursier/setup-action@v1.3.0
Expand Down
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 -e
# 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' }}
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
" Format on save
autocmd BufWritePre <buffer> LspDocumentFormatSync
" Some optionnal mappings
" Some optional mappings
nmap <buffer> <leader>i <Plug>(lsp-hover)
" Following mappings are not supported yet by gnols
" nmap <buffer> gd <plug>(lsp-definition)
Expand Down Expand Up @@ -273,7 +273,7 @@ your PR's comments if you don't).

Additionally, we have a few testing systems that stray from this general rule;
at the time of writing, these are for integration tests and language tests. You
can find more documentation about them [on this guide](gno/docs/testing-guide.md).
can find more documentation about them [on this guide](docs/testing-guide.md).

### Repository Structure

Expand Down
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
Loading

0 comments on commit 222ef72

Please sign in to comment.