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

refactor: reorganize project, isolate components (tm2, gnovm, gno.land, ...) #585

Merged
merged 10 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
38 changes: 0 additions & 38 deletions .github/workflows/build.yml

This file was deleted.

15 changes: 6 additions & 9 deletions .github/workflows/db-tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
name: DB Tests
name: db-tests

on:
pull_request:
paths:
- "pkgs/db"
- "go.mod"
- "t2/pkg/db/**.go"
- "go.sum"
- ".github/workflows/db-tests.yml"
push:
branches:
- master
branches: [ $default-branch ]

jobs:
test-databases:
name: basic database test
test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
Expand Down Expand Up @@ -44,5 +41,5 @@ jobs:

# test ./pkgs/db
- uses: actions/checkout@v3
- name: test ./pkgs/db
run: go test -tags ${{ matrix.tags }} ./pkgs/db/...
- name: test ./tm2/pkg/db
run: go test -tags ${{ matrix.tags }} ./tm2/pkg/db/...
14 changes: 6 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker
name: docker
on:
pull_request:
paths:
Expand All @@ -7,13 +7,11 @@ on:
- "!docs/**"
- "!**.md"
push:
branches:
- master
branches: [ $default-branch ]

jobs:
build-push:
runs-on: ubuntu-latest
name: "Build & Push Container"
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -33,13 +31,13 @@ jobs:
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=gnodev-slim -t ghcr.io/${owner}/${reponame}/gnodev-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}/gnodev-slim:latest ghcr.io/${owner}/${reponame}/gnodev-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}

Expand Down Expand Up @@ -70,8 +68,8 @@ jobs:
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}/gnodev-slim:latest
docker push ghcr.io/${owner}/${reponame}/gnodev-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}
Expand Down
26 changes: 11 additions & 15 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: Gno Examples
name: examples

on:
pull_request:
paths:
- "**.go"
- "**.gno"
- "go.mod"
- "go.sum"
- "gnovm/**.go"
- "gnovm/**.gno"
- "gnovm/**/go.sum"
- "examples/**.gno"
- ".github/workflows/examples.yml"
- "Makefile"
push:
branches:
- master
branches: [ $default-branch ]

jobs:
go-test:
name: Gno Examples
gno2go:
strategy:
fail-fast: false
matrix:
Expand All @@ -27,9 +25,7 @@ jobs:
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- run: go install -v ./cmd/gnodev
# TODO: implement --allow-all-imports
#- run: gnodev precompile ./stdlibs --verbose --allow-all-imports
#- run: gnodev precompile ./tests --verbose --allow-all-imports
- run: go run ./cmd/gnodev precompile --verbose ./examples
- run: go run ./cmd/gnodev build --verbose ./examples
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno precompile --verbose ./examples
- run: go run ./gnovm/cmd/gno build --verbose ./examples
# unittests: TODO: matrix with contracts
60 changes: 60 additions & 0 deletions .github/workflows/gnoland.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: gno.land

on:
pull_request:
paths:
- "go.sum"
- "gnovm/**.go"
- "gnovm/**.gno"
- "tm2/**.go"
- "gno.land/**"
- ".github/workflows/gnovm.yml"
push:
branches: [ $default-branch ]

jobs:
build:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goarch: [ "amd64" ]
goos: [ "linux" ]
program:
- gnoland
- gnokey
- gnoweb
- gnofaucet
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: go install
working-directory: gno.land
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }}

test:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
args:
- _test.gnoland
- _test.gnokey
- _test.pkgs
#- _test.gnoweb # this test should be rewritten to run an inmemory localnode
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: test
working-directory: gno.land
run: |
export GOPATH=$HOME/go
make ${{ matrix.args }}
62 changes: 62 additions & 0 deletions .github/workflows/gnovm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: gnovm

on:
pull_request:
paths:
- "go.sum"
- "gnovm/**.go"
- "gnovm/**.gno"
- "gnovm/**/go.sum"
- "gnovm/Makefile"
- "tm2/**.go"
- ".github/workflows/gnovm.yml"
push:
branches: [ $default-branch ]

jobs:
build:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goarch: [ "amd64" ]
goos: [ "linux" ]
program: [ "gno" ]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: go install
working-directory: gnovm
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }}

test:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
args:
- _test.cmd
- _test.pkg
- _test.gnolang.native
- _test.gnolang.stdlibs
- _test.gnolang.realm
- _test.gnolang.pkg0
- _test.gnolang.pkg1
- _test.gnolang.pkg2
- _test.gnolang.other
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: test
working-directory: gnovm
run: |
export GOPATH=$HOME/go
make ${{ matrix.args }}
5 changes: 2 additions & 3 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Lint PR"
name: "lint-pr"

on:
pull_request_target:
Expand All @@ -8,8 +8,7 @@ on:
- synchronize

jobs:
main:
name: Validate PR title
pr-title:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/lint.yml → .github/workflows/misc.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Lint
name: misc

on:
push:
branches:
- master
branches: [ $default-branch ]
pull_request:

jobs:
lint:
name: Linter Workflow
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
go-version: 1.20.x

- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -24,15 +22,14 @@ jobs:
with:
version: v1.51
args:
--config=./.golangci.yaml
--config=./.github/golangci.yml
fmt:
name: Format checker
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19.x
go-version: 1.20.x

- name: Install make
run: sudo apt-get install -y make
Expand Down
Loading