Skip to content

Commit

Permalink
Merge branch 'master' into feature/simple-tx-indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
zivkovicmilos committed Oct 19, 2023
2 parents b9b16d0 + 09dfe6e commit d43a83f
Show file tree
Hide file tree
Showing 176 changed files with 8,007 additions and 594 deletions.
15 changes: 15 additions & 0 deletions .github/.fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 3

# https://github.com/fossas/fossa-cli/blob/master/docs/references/files/fossa-yml.md

project:
id: github.com/gnolang/gno
name: gno

targets:
only:
- type: gomod

paths:
exclude:
- ./misc/
54 changes: 39 additions & 15 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,54 @@
codecov:
require_ci_to_pass: no
require_ci_to_pass: false
notify:
wait_for_ci: no
wait_for_ci: true

ignore:
- misc

comment: false # will use it later.
comment:
require_changes: false

coverage:
round: down
precision: 2
status:
project: off
patch: off
project:
default:
target: auto
threshold: 10 # Let's decrease this later.
base: parent
if_no_uploads: error
if_not_found: success
if_ci_failed: error
only_pulls: false
patch:
default:
target: auto
threshold: 100 # Allows PRs without tests, overall stats count.
base: auto
if_no_uploads: error
if_not_found: success
if_ci_failed: error
only_pulls: false

flags:
flag_management:
default_rules:
carryforward: true
tm2:
paths:
statuses:
- type: project
target: auto
threshold: 10 # Let's decrease this later.
- type: patch
target: auto # Allows PRs without tests, overall stats count.
threshold: 100
individual_flags:
- name: tm2
paths:
- tm2
after_n_builds: 4
gnovm:
paths:
- name: gnovm
paths:
- gnovm
after_n_builds: 9
gno.land:
paths:
- name: gno.land
paths:
- gno.land
after_n_builds: 3
9 changes: 5 additions & 4 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ on:
type: string
jobs:
benchmarks:
if: ${{ github.repository == 'gnolang/gno' }}
runs-on: [self-hosted, Linux, X64, benchmark-v1]
steps:
- name: checkout
uses: actions/checkout@v3
with:
uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-go@v4
with:
go-version: "1.20"
with:
go-version: "1.21.x"
- name: "gobenchdata publish: ${{ inputs.publish }}"
run: go run go.bobheadxi.dev/gobenchdata@v1 action
env:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/db-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,21 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goversion:
- "1.20.x"
- "1.21.x"
tags:
- cleveldb
- memdb
- fsdb
- boltdb
steps:
- uses: actions/checkout@v4

# golang
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
go-version: ${{ matrix.goversion }}

# leveldb
- name: install leveldb
Expand All @@ -44,6 +48,5 @@ jobs:
sudo dpkg -i *.deb
# test ./pkgs/db
- uses: actions/checkout@v3
- name: test ./tm2/pkg/db
run: go test -tags ${{ matrix.tags }} ./tm2/pkg/db/...
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build main Docker image
env:
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,51 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goversion:
- "1.20.x"
- "1.21.x"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
go-version: ${{ matrix.goversion }}
- 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
test:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goversion:
- "1.20.x"
- "1.21.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
go-version: ${{ matrix.goversion }}
- run: go install -v ./gnovm/cmd/gno
- run: go run ./gnovm/cmd/gno test --verbose ./examples
- run: go run ./gnovm/cmd/gno test --verbose ./examples/...
lint:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goversion:
- "1.20.x"
- "1.21.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
go-version: ${{ matrix.goversion }}
- run: go install -v ./gnovm/cmd/gno
# testing official directories, basically examples/ minus examples/.../x/.
- run: go run ./gnovm/cmd/gno lint --verbose ./examples/gno.land/p
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Dependency License Scanning

on:
workflow_dispatch:
pull_request:
paths:
- ".github/.fossa.yml"
- ".github/workflows/fossa.yml"
schedule:
- cron: '0 0 * * 6' # At 00:00 on saturdays

permissions:
contents: read

jobs:
fossa:
name: Fossa
runs-on: ubuntu-latest
if: github.repository == 'gnolang/gno'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Move .fossa.yml to root dir
run: mv .github/.fossa.yml .

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

- name: Set up JDK 17
uses: coursier/setup-action@v1.3.0
with:
jvm: temurin:1.17

- name: Set up fossa CLI
run: "curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash"

- name: FOSSA analyze
run: fossa analyze
env:
FOSSA_API_KEY: "${{secrets.FOSSA_API_KEY}}"

- name: FOSSA test
run: fossa test
env:
FOSSA_API_KEY: "${{secrets.FOSSA_API_KEY}}"

4 changes: 3 additions & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ concurrency:

jobs:
build:
if: ${{ github.repository == 'gnolang/gno' }} # Alternatively, validate based on provided tokens and permissions.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: "cd misc/devdeps && make install"
- run: "cd misc/gendocs && make gen"
- run: "find docs/ -type f -ls"
Expand All @@ -30,6 +31,7 @@ jobs:
path: ./misc/gendocs/godoc

deploy:
if: ${{ github.repository == 'gnolang/gno' }} # Alternatively, validate based on provided tokens and permissions.
runs-on: ubuntu-latest
environment:
name: github-pages
Expand Down
59 changes: 45 additions & 14 deletions .github/workflows/gnoland.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
- "tm2/**.go"
- "gno.land/**"
- ".github/workflows/gnovm.yml"
# Until the codecov issue is resolved, it's essential to run the tests for gnovm, tm2, and gno.land concurrently.
- "gnovm/**"
- "tm2/**"
- "gno.land/**"
- "examples/**"
- ".github/workflows/**"
push:
branches: [ "master" ]

Expand All @@ -21,21 +27,24 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goversion:
- "1.20.x"
- "1.21.x"
goarch: [ "amd64" ]
goos: [ "linux" ]
program:
- gnoland
- gnokey
- gnoweb
- gnofaucet
- gnotxsync
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
go-version: ${{ matrix.goversion }}
- name: go install
working-directory: gno.land
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go install ./cmd/${{ matrix.program }}
Expand All @@ -44,42 +53,64 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: [ "1.19.x", "1.20.x" ]
goversion:
- "1.20.x"
- "1.21.x"
args:
- _test.gnoland
- _test.gnokey
- _test.pkgs
#- _test.gnoweb # this test should be rewritten to run an inmemory localnode
# XXX: test broken, should be rewritten to run an inmemory localnode
# Re-add to makefile when fixed. Tracked here: https://github.com/gnolang/gno/issues/1222
#- _test.gnoweb
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
go-version: ${{ matrix.goversion }}
- name: test
working-directory: gno.land
run: |
export GOPATH=$HOME/go
export GOTEST_FLAGS="-v -p 1 -timeout=30m -coverprofile=coverage.out -covermode=atomic"
export LOG_DIR="${{ runner.temp }}/logs/test-${{ matrix.goversion }}-gnoland"
make ${{ matrix.args }}
- if: runner.os == 'Linux'
- name: Upload Test Log
if: always()
uses: actions/upload-artifact@v3
with:
name: logs-test-gnoland-go${{ matrix.goversion }}
path: ${{ runner.temp }}/logs/**/*.log
- uses: actions/upload-artifact@v3
if: ${{ runner.os == 'Linux' && matrix.goversion == '1.21.x' }}
with:
name: ${{runner.os}}-coverage-gnoland-${{ matrix.args}}-${{matrix.goversion}}
path: ./gno.land/coverage.out

upload-coverage:
needs: test
runs-on: ubuntu-latest
steps:
- name: Download all previous coverage artifacts
uses: actions/download-artifact@v3
with:
path: ${{ runner.temp }}/coverage
- name: Upload combined coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: ${{ runner.temp }}/coverage
token: ${{ secrets.CODECOV_TOKEN }}
name: gno.land
flags: gno.land,gno.land-${{matrix.args}},go-${{ matrix.go-version }}
files: ./gno.land/coverage.out
#fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}
fail_ci_if_error: false # temporarily
fail_ci_if_error: ${{ github.repository == 'gnolang/gno' }}

docker-integration:
strategy:
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# TODO: setup docker caching
- run: make test.docker
- run: docker logs int_gnoland || true
Expand Down
Loading

0 comments on commit d43a83f

Please sign in to comment.