Skip to content

Commit

Permalink
Merge branch 'master' into fix/test-std.PrevRealm
Browse files Browse the repository at this point in the history
  • Loading branch information
tbruyelle committed Jun 16, 2023
2 parents 12e49f2 + b6dc190 commit 3f95ce1
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# generate docs and publish on gh-pages branch
name: gh-pages

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

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: "cd misc/devdeps && make install"
- run: "cd misc/gendocs && make gen"
- run: "find docs/ -type f -ls"
- uses: actions/configure-pages@v3
id: pages
- uses: actions/upload-pages-artifact@v1
with:
path: ./misc/gendocs/godoc

deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
steps:
- uses: actions/deploy-pages@v2
id: deployment
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,32 @@ Also, see the [quickstart guide](https://test3.gno.land/r/demo/boards:testboard/
* [genproto](./misc/genproto) - helper for generating .proto implementations
* [gnofaucet](./gno.land/cmd/gnofaucet) - serves GNOT faucet
</details>

<details><summary>CI/CD/Tools badges and links</summary>

GitHub Actions:

* [![gno.land](https://github.com/gnolang/gno/actions/workflows/gnoland.yml/badge.svg)](https://github.com/gnolang/gno/actions/workflows/gnoland.yml)
* [![gnovm](https://github.com/gnolang/gno/actions/workflows/gnovm.yml/badge.svg)](https://github.com/gnolang/gno/actions/workflows/gnovm.yml)
* [![tm2](https://github.com/gnolang/gno/actions/workflows/tm2.yml/badge.svg)](https://github.com/gnolang/gno/actions/workflows/tm2.yml)
* [![examples](https://github.com/gnolang/gno/actions/workflows/examples.yml/badge.svg)](https://github.com/gnolang/gno/actions/workflows/examples.yml)
* [![docker](https://github.com/gnolang/gno/actions/workflows/docker.yml/badge.svg)](https://github.com/gnolang/gno/actions/workflows/docker.yml)

Codecov:

* General: [![codecov](https://codecov.io/gh/gnolang/gno/branch/master/graph/badge.svg?token=HPP82HR1P4)](https://codecov.io/gh/gnolang/gno)
* tm2: [![codecov](https://codecov.io/gh/gnolang/gno/branch/master/graph/badge.svg?token=HPP82HR1P4&flag=tm2)](https://codecov.io/gh/gnolang/gno/tree/master/tm2)
* gnovm: [![codecov](https://codecov.io/gh/gnolang/gno/branch/master/graph/badge.svg?token=HPP82HR1P4&flag=gnovm)](https://codecov.io/gh/gnolang/gno/tree/master/gnovm)
* gno.land: [![codecov](https://codecov.io/gh/gnolang/gno/branch/master/graph/badge.svg?token=HPP82HR1P4&flag=gno.land)](https://codecov.io/gh/gnolang/gno/tree/master/gno.land)
* examples: TODO

Go Report Card:

* [![Go Report Card](https://goreportcard.com/badge/github.com/gnolang/gno)](https://goreportcard.com/report/github.com/gnolang/gno)
* tm2, gnovm, gno.land: TODO (blocked by tm2 split, because we need go mod workspaces)

Pkg.go.dev

* [![Go Reference](https://pkg.go.dev/badge/github.com/gnolang/gno.svg)](https://pkg.go.dev/github.com/gnolang/gno)
* TODO: host custom docs on gh-pages, to bypass license limitation
</details>
4 changes: 2 additions & 2 deletions gnovm/pkg/gnolang/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ func (m *Machine) Release() {
m.NumOps = 0
m.NumValues = 0
// this is the fastest way to zero-in a slice in Go
copy(m.Ops, opZeroed[:0])
copy(m.Values, valueZeroed[:0])
copy(m.Ops, opZeroed[:])
copy(m.Values, valueZeroed[:])

machinePool.Put(m)
}
Expand Down
2 changes: 1 addition & 1 deletion misc/deployments/staging.gno.land/overlay/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ timeout_commit = "1s"
skip_timeout_commit = false

# EmptyBlocks mode and possible interval between empty blocks
create_empty_blocks = false
create_empty_blocks = true
create_empty_blocks_interval = "1m0s"

# Reactor sleep duration parameters
Expand Down
1 change: 1 addition & 0 deletions misc/devdeps/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
install:
go install mvdan.cc/gofumpt
go install google.golang.org/protobuf/cmd/protoc-gen-go
go install golang.org/x/tools/cmd/godoc
3 changes: 3 additions & 0 deletions misc/devdeps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ import (

// protoc, genproto
_ "google.golang.org/protobuf/cmd/protoc-gen-go"

// gen docs
_ "golang.org/x/tools/cmd/godoc"
)
1 change: 1 addition & 0 deletions misc/devdeps/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/peterbourgon/ff/v3 v3.3.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/stretchr/testify v1.7.1 // indirect
github.com/yuin/goldmark v1.4.13 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
golang.org/x/exp v0.0.0-20221026153819-32f3d567a233 // indirect
Expand Down
2 changes: 2 additions & 0 deletions misc/devdeps/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions misc/gendocs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
godoc/
10 changes: 10 additions & 0 deletions misc/gendocs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
all: clean gen

gen:
./gendocs.sh

clean:
rm -rf godoc

kill_zombies:
kill -9 `lsof -t -i tcp:6060 -s TCP:LISTEN` || true
35 changes: 35 additions & 0 deletions misc/gendocs/gendocs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

GODOC_PORT=${GODOC_PORT:-6060}
GO_MODULE=${GO_MODULE:-github.com/gnolang/gno}
GODOC_OUT=${GODOC_OUT:-godoc}
URL=http://localhost:${GODOC_PORT}/pkg/github.com/gnolang/gno/

echo "[+] Starting godoc server..."
go run \
-modfile ../devdeps/go.mod \
golang.org/x/tools/cmd/godoc \
-http="localhost:${GODOC_PORT}" &
PID=$!
# Waiting for godoc server
while ! curl --fail --silent "$URL" > /dev/null 2>&1; do
sleep 0.1
done

echo "[+] Downloading godoc pages..."
wget \
--recursive \
--no-verbose \
--convert-links \
--page-requisites \
--adjust-extension \
--execute=robots=off \
--include-directories="/lib,/pkg/$GO_MODULE,/src/$GO_MODULE" \
--exclude-directories="*" \
--directory-prefix="${GODOC_OUT}" \
--no-host-directories \
"$URL?m=all"

echo "[+] Killing godoc server..."
kill -9 "$PID"

0 comments on commit 3f95ce1

Please sign in to comment.