Skip to content

Commit

Permalink
attempt ci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl committed Feb 9, 2024
1 parent 3ce64e3 commit 5a394ea
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2,267 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/rules.yml → .github/workflows/perft.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: rules
name: perft

on:
pull_request:
paths:
- "realm/rules.gno"
- "package/**"
- "Makefile"
- "go.sum"
push:
branches:
- master
Expand All @@ -19,4 +21,4 @@ jobs:
with:
go-version: 'stable'
- run: go mod download -x
- run: go run github.com/gnolang/gno/gnovm/cmd/gno test -verbose -run 'TestPerft' ./realm
- run: make test.perft
3 changes: 2 additions & 1 deletion .github/workflows/realm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
paths:
- "realm/**"
- "packages/**"
- "Makefile"
- "go.sum"
push:
Expand All @@ -21,4 +22,4 @@ jobs:
with:
go-version: 'stable'
- run: go mod download -x
- run: go run github.com/gnolang/gno/gnovm/cmd/gno test -verbose ./realm
- run: make test
26 changes: 16 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ GNOCMD ?= go run github.com/gnolang/gno/gnovm/cmd/gno
GNODEV ?= go run github.com/gnolang/gno/contribs/gnodev

GNOROOT ?= `gno env GNOROOT`
GNO_TEST_FLAGS ?= -verbose -run '^Test(?:[^P]|P[^e]|Pe[^r])'
GNO_TEST_FLAGS ?= -verbose
GNO_TEST_PKGS ?= gno.land/p/demo/chess/... gno.land/r/demo/chess

MNEMONIC_TEST1 ?= source bonus chronic canvas draft south burst lottery vacant surface solve popular case indicate oppose farm nothing bullet exhibit title speed wink action roast

.PHONY: help
help: ## Display this help message.
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make [\033[36m<target>\033[0m...]\n"} /^[0-9a-zA-Z_\.-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make [\033[36m<target>\033[0m...]\n"} /^[[0-9a-zA-Z_\.-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

.PHONY: clean
clean: ## Remove temporary files.
find . -name '*.gen.go' -exec rm -rf {} +
rm -rf .test

.PHONY: test
test: ## Test packages and realms.
.PHONY: test.prepare
test.prepare:
rm -rf .test
# Create fake GNOROOT with stdlibs, testing stdlibs, and p/ dependencies.
# This is currently necessary as gno.mod's `replace` functionality is not linked with the VM.
Expand All @@ -35,12 +35,14 @@ test: ## Test packages and realms.
# Copy over gnochess code.
cp -r "$(PWD)/package" ".test/examples/gno.land/p/demo/chess"
cp -r "$(PWD)/realm" ".test/examples/gno.land/r/demo/chess"
# Test.
cd .test/examples; GNOROOT="$(PWD)/.test" $(GNOCMD) test $(GNO_TEST_FLAGS) $(GNO_TEST_PKGS)

gnokey.add_test1: ## Add an account that will be used for Realm deployment (to gnokey).
printf '\n\n%s\n\n' "$(MNEMONIC_TEST1)" | $(GNOKEY) add --recover --insecure-password-stdin test1 || true
$(GNOKEY) list | grep test1
.PHONY: test
test: test.prepare ## Test packages and realms.
cd .test/examples; GNOROOT="$(PWD)/.test" $(GNOCMD) test -run '^Test(?:[^P]|P[^e]|Pe[^r])' $(GNO_TEST_FLAGS) $(GNO_TEST_PKGS)

.PHONY: test.perft
test.perft: test.prepare ## Run perft tests.
cd .test/examples; GNOROOT="$(PWD)/.test" $(GNOCMD) test -run 'TestPerft' $(GNO_TEST_FLAGS) gno.land/p/demo/chess

run.faucet: ## Run the GnoChess faucet.
cd faucet; go run main.go \
Expand Down Expand Up @@ -89,7 +91,11 @@ run.web: ## Run the web server.
run.gnodev: ## Run gnodev with the gnochess packages and realm.
$(GNODEV) ./package/glicko2 ./package/zobrist ./package ./realm

z_test_integration: ## Test the realm.
z_add_test1: ## Add the test1 key to gnokey.
printf '\n\n%s\n\n' "$(MNEMONIC_TEST1)" | $(GNOKEY) add --recover --insecure-password-stdin test1 || true
$(GNOKEY) list | grep test1

z_test_integration: ## Test the realm using integration tests.
go test -v -run='TestIntegration/.*' .

z_build_realm: ## Precompile and build the generated Go files. Assumes a working clone of gno in ../gno.
Expand Down
2 changes: 1 addition & 1 deletion realm/lobby.gno
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var (
)

func LobbyJoin(seconds, increment int) {
std.AssertOriginCall()
assertOriginCall()

var tc tcLobby
switch {
Expand Down
25 changes: 0 additions & 25 deletions util/gnolanddev/Dockerfile

This file was deleted.

237 changes: 0 additions & 237 deletions util/gnolanddev/config.toml

This file was deleted.

Loading

0 comments on commit 5a394ea

Please sign in to comment.