Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: try to automate bug in gnolang/gnochess#97 #1172

Closed
wants to merge 75 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
a938f69
initial poc
thehowl May 30, 2023
5358970
Merge branch 'master' of github.com:gnolang/gno into dev/native-bindi…
thehowl Jun 9, 2023
6153b6a
changes
thehowl Jun 20, 2023
0002819
add injector call
thehowl Jun 20, 2023
cd94b0c
log ptrs
thehowl Jun 20, 2023
6248c80
change approach to "NativeStore"
thehowl Jun 23, 2023
b70c124
Merge branch 'master' of github.com:gnolang/gno into dev/native-bindi…
thehowl Jun 23, 2023
9fc487a
remove old debug call
thehowl Jun 23, 2023
da4f9a8
make AssertOriginCall native gno
thehowl Jul 7, 2023
9edecac
more permanent location and name for stdgen
thehowl Jul 7, 2023
c4094d2
allow overriding std functions in test context
thehowl Jul 10, 2023
bc2d558
implement SkipHeights, add NativeStore elsewhere
thehowl Jul 10, 2023
d27a7ca
fix native bindings in realms
thehowl Jul 12, 2023
c876012
Merge branch 'master' of github.com:gnolang/gno into dev/native-bindi…
thehowl Jul 12, 2023
0f54a0c
fix low-hanging failing tests
thehowl Jul 12, 2023
3a985fc
remove unused code, add more docs
thehowl Jul 12, 2023
f2d8894
more docs & text fixes
thehowl Jul 12, 2023
daa58c9
Merge branch 'master' into dev/native-bindings-poc
thehowl Jul 24, 2023
50c919d
ci: add workflow to ensure go generate is executed
thehowl Jul 24, 2023
73e411e
add generate to make
thehowl Jul 24, 2023
6fa6c91
test: extract PrevRealm algorithm in tested function
tbruyelle Jun 15, 2023
a03e99d
refac: prevRealm returns a Realm type
tbruyelle Jun 15, 2023
4b7a50b
refac: prevRealm
tbruyelle Jun 15, 2023
450fcba
use prevRealm in IsOriginCall/AssertOriginCall
tbruyelle Jun 15, 2023
57ae33a
revert rename
tbruyelle Aug 10, 2023
59eb5fa
fix tests, no longer need function literal thx to prevrealm usage
tbruyelle Aug 10, 2023
f845ad3
fix r/demo/boards tests
tbruyelle Aug 10, 2023
9a5910a
add comments
tbruyelle Aug 11, 2023
1725cd2
fix typo
tbruyelle Aug 11, 2023
b1d6a3d
convert all injections to new native bindings
thehowl Aug 23, 2023
3560f42
add native.go files as generated
thehowl Aug 23, 2023
82e113c
Merge branch 'master' of github.com:gnolang/gno into dev/native-bindi…
thehowl Aug 23, 2023
6452305
add // injected comment on all injected fns
thehowl Aug 23, 2023
ed81331
address PR comments
thehowl Aug 23, 2023
b661430
support returning gno.TypedValue, for specialcasing GetBanker
thehowl Aug 23, 2023
5bda745
fix failing cmd tests
thehowl Aug 23, 2023
e1bf401
refactor genstd field iteration
thehowl Aug 23, 2023
60525e3
typo
thehowl Aug 23, 2023
b6a6c5d
Update gnovm/pkg/gnolang/gonative.go
thehowl Aug 30, 2023
62afd22
add tests
thehowl Aug 31, 2023
0e787fa
update makefiles & workflows
thehowl Aug 31, 2023
9f3f261
add misc to codecov
thehowl Aug 31, 2023
ec9f5da
address TODO in filterDuplicates
thehowl Sep 6, 2023
d7de22f
Merge branch 'master' of github.com:gnolang/gno into dev/native-bindi…
thehowl Sep 6, 2023
a3b25e5
add stdlibs documentation file;
thehowl Sep 6, 2023
a68cfe4
fix ci
thehowl Sep 6, 2023
a89302f
remove 1.20 from versions for genstd
thehowl Sep 6, 2023
a39ec5f
Merge branch 'master' into refac/assertOriginCaller
moul Sep 7, 2023
2842524
fix tests
tbruyelle Sep 8, 2023
27d1379
fix other tests
tbruyelle Sep 8, 2023
0969a7d
fix(gnolang): allow comparisons using uninitialized string values
thehowl Sep 16, 2023
48132ab
add other case for uverse pkg
thehowl Sep 16, 2023
c3200a6
Merge branch 'master' of github.com:gnolang/gno into dev/native-bindi…
thehowl Sep 16, 2023
7e91e74
Merge remote-tracking branch 'origin/dev/morgan/compare-zero-val' int…
thehowl Sep 16, 2023
a3b5670
Merge branch 'refac/assertOriginCaller' into patch/gnochess
thehowl Sep 16, 2023
f95490e
fix golden tests
thehowl Sep 16, 2023
d69b633
fix assert/isorigincall not working
thehowl Sep 16, 2023
63d6e93
feat(stdlibs): add math and math/bits
thehowl Sep 18, 2023
13acb1b
add DEBUG_PRINT_EVAL
thehowl Sep 18, 2023
e787c76
Merge remote-tracking branch 'origin/dev/morgan/stdlibs-math' into pa…
thehowl Sep 18, 2023
86c3200
no imath
thehowl Sep 18, 2023
8c2fbbd
branch workflows
thehowl Sep 19, 2023
d74946b
xxx docker
thehowl Sep 19, 2023
2dd9e6c
consensus params * 10
thehowl Sep 19, 2023
b7644b4
allow printing unexported struct fields
thehowl Sep 19, 2023
b2cd739
feat(stdlibs): add FormatFloat to strconv
thehowl Sep 19, 2023
a75bbc5
fmt
thehowl Sep 19, 2023
d1193a2
copy native store in Store.Fork
thehowl Sep 20, 2023
ae15a15
fix http client not using https
thehowl Sep 21, 2023
67b75ba
Change consensus params
thehowl Sep 22, 2023
3665620
feat: add txtar driver to gnoland
gfanton Sep 12, 2023
f5c62d4
feat: export gnoland integration function
gfanton Sep 25, 2023
73d1505
chore: try to automate bug in gnolang/gnochess#97
moul Sep 25, 2023
630a414
chore: fixup
moul Sep 25, 2023
746eb1b
chore: fixup
moul Sep 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ flags:
paths:
- gno.land
after_n_builds: 3
misc:
paths:
- misc
after_n_builds: 1
2 changes: 1 addition & 1 deletion .github/workflows/db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "go.sum"
- ".github/workflows/db-tests.yml"
push:
branches: [ "master" ]
branches: [ "patch/gnochess" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
42 changes: 5 additions & 37 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "!docs/**"
- "!**.md"
push:
branches: [ "master" ]
branches: [ "patch/gnochess" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -25,25 +25,8 @@ jobs:
owner: ${{ github.repository_owner }}
reponame: ${{ github.event.repository.name }}
run: |
docker build -t ghcr.io/${owner}/${reponame} .
docker tag ghcr.io/${owner}/${reponame}:latest ghcr.io/${owner}/${reponame}:${GITHUB_SHA::8}

- name: Build slim Docker images
env:
owner: ${{ github.repository_owner }}
reponame: ${{ github.event.repository.name }}
run: |
docker build --target=gnoland-slim -t ghcr.io/${owner}/${reponame}/gnoland-slim .
docker build --target=gnokey-slim -t ghcr.io/${owner}/${reponame}/gnokey-slim .
docker build --target=gno-slim -t ghcr.io/${owner}/${reponame}/gno-slim .
docker build --target=gnofaucet-slim -t ghcr.io/${owner}/${reponame}/gnofaucet-slim .
docker build --target=gnoweb-slim -t ghcr.io/${owner}/${reponame}/gnoweb-slim .

docker tag ghcr.io/${owner}/${reponame}/gnoland-slim:latest ghcr.io/${owner}/${reponame}/gnoland-slim:${GITHUB_SHA::8}
docker tag ghcr.io/${owner}/${reponame}/gnokey-slim:latest ghcr.io/${owner}/${reponame}/gnokey-slim:${GITHUB_SHA::8}
docker tag ghcr.io/${owner}/${reponame}/gno-slim:latest ghcr.io/${owner}/${reponame}/gno-slim:${GITHUB_SHA::8}
docker tag ghcr.io/${owner}/${reponame}/gnofaucet-slim:latest ghcr.io/${owner}/${reponame}/gnofaucet-slim:${GITHUB_SHA::8}
docker tag ghcr.io/${owner}/${reponame}/gnoweb-slim:latest ghcr.io/${owner}/${reponame}/gnoweb-slim:${GITHUB_SHA::8}
docker build -t ghcr.io/${owner}/${reponame}/gnochess .
docker tag ghcr.io/${owner}/${reponame}/gnochess:latest ghcr.io/${owner}/${reponame}/gnochess:${GITHUB_SHA::8}

- name: List docker images
run: |
Expand All @@ -63,20 +46,5 @@ jobs:
owner: ${{ github.repository_owner }}
reponame: ${{ github.event.repository.name }}
run: |
docker push ghcr.io/${owner}/${reponame}:latest
docker push ghcr.io/${owner}/${reponame}:${GITHUB_SHA::8}

docker push ghcr.io/${owner}/${reponame}/gnoland-slim:latest
docker push ghcr.io/${owner}/${reponame}/gnoland-slim:${GITHUB_SHA::8}

docker push ghcr.io/${owner}/${reponame}/gnokey-slim:latest
docker push ghcr.io/${owner}/${reponame}/gnokey-slim:${GITHUB_SHA::8}

docker push ghcr.io/${owner}/${reponame}/gno-slim:latest
docker push ghcr.io/${owner}/${reponame}/gno-slim:${GITHUB_SHA::8}

docker push ghcr.io/${owner}/${reponame}/gnofaucet-slim:latest
docker push ghcr.io/${owner}/${reponame}/gnofaucet-slim:${GITHUB_SHA::8}

docker push ghcr.io/${owner}/${reponame}/gnoweb-slim:latest
docker push ghcr.io/${owner}/${reponame}/gnoweb-slim:${GITHUB_SHA::8}
docker push ghcr.io/${owner}/${reponame}/gnochess:latest
docker push ghcr.io/${owner}/${reponame}/gnochess:${GITHUB_SHA::8}
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "examples/**.gno"
- ".github/workflows/examples.yml"
push:
branches: [ "master" ]
branches: [ "patch/gnochess" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gnoland.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- "gno.land/**"
- ".github/workflows/gnovm.yml"
push:
branches: [ "master" ]
branches: [ "patch/gnochess" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gnovm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- "tm2/**.go"
- ".github/workflows/gnovm.yml"
push:
branches: [ "master" ]
branches: [ "patch/gnochess" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: lint

on:
push:
branches: [ "patch/gnochess" ]
pull_request:

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

jobs:
lint:
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: 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: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

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

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

# 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:
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 go.mods
run: |
sums="$(sha256sum go.mod misc/devdeps/go.mod)"
for path in . ./misc/devdeps; do
env -C $path go mod tidy -v || exit 1
done
echo "$sums" | sha256sum -c
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
106 changes: 47 additions & 59 deletions .github/workflows/misc.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,66 @@
# tests the "misc" directory & tools
# (not meant for miscellaneous workflows)
name: misc

on:
push:
branches: [ "master" ]
pull_request:
paths:
- "misc/genstd/**.go"
- "misc/Makefile"
- ".github/workflows/misc.yml"
push:
branches: [ "patch/gnochess" ]

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

jobs:
lint:
build:
strategy:
fail-fast: false
matrix:
go-version: # two latest versions
- "1.21.x"
program:
- "genstd"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Install Go
uses: actions/setup-go@v4
- uses: actions/setup-go@v4
with:
go-version: 1.21.x
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- name: go install
working-directory: misc
run: go install ./${{ matrix.program }}

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

- name: Lint
uses: golangci/golangci-lint-action@v3
with:
# sync with misc/devdeps/go.mod
version: v1.54
args:
--config=./.github/golangci.yml
fmt:
test:
strategy:
fail-fast: false
matrix:
go-version:
- "1.21.x"
args:
- _test.genstd
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Install Go
uses: actions/setup-go@v4
- uses: actions/setup-go@v4
with:
go-version: 1.20.x

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

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

# 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
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- name: test
working-directory: misc
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:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
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:
go-version: 1.20.x

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

- name: Check go.mods
run: |
sums="$(sha256sum go.mod misc/devdeps/go.mod)"
for path in . ./misc/devdeps; do
env -C $path go mod tidy -v || exit 1
done
echo "$sums" | sha256sum -c
token: ${{ secrets.CODECOV_TOKEN }}
name: misc
flags: misc,misc-${{matrix.args}},go-${{ matrix.go-version }}
files: ./misc/coverage.out
fail_ci_if_error: false # temporarily
2 changes: 1 addition & 1 deletion .github/workflows/tm2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "tm2/**.go"
- ".github/workflows/tm2.yml"
push:
branches: [ "master" ]
branches: [ "patch/gnochess" ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
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