Skip to content

Commit

Permalink
Merge pull request #1307 from iotaledger/develop
Browse files Browse the repository at this point in the history
0.3.1 release
  • Loading branch information
fijter authored Sep 15, 2022
2 parents c2966c1 + da43d70 commit 92af7ce
Show file tree
Hide file tree
Showing 570 changed files with 6,022 additions and 3,187 deletions.
32 changes: 24 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
Dockerfile
.github
.git
.*
.git
.github
.github
.idea
.vscode
.waypoint
*.bat
*.log
*.md
*.png
*.toml
*.tpl
*.hcl
contracts/wasm
Dockerfile
docOps/
documentation
evmemulator
gascalibration
packages/snapshot
packges/vm/wasmlib
schema
snapshot
tools
wal
wasp
wasp-cli
*.log
waspdb/
docOps/
tools/devnet
tools/cluster
wasp-cluster
waspdb

36 changes: 17 additions & 19 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Test
run: make test-short

contract-test:
name: Wasm contract tests
runs-on: ubuntu-latest
Expand All @@ -43,25 +43,25 @@ jobs:
- name: install golang
uses: actions/setup-go@v3
with:
go-version: '1.18.5'
go-version: "1.18.5"

- name: install tinygo
# only work on x86_64
run: |
wget https://github.com/tinygo-org/tinygo/releases/download/v0.23.0/tinygo_0.23.0_amd64.deb
sudo dpkg -i tinygo_0.23.0_amd64.deb
export PATH=$PATH:/usr/local/bin
- name: install rust-toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
toolchain: stable

- name: install wasm-pack
run: |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: install Node.js
- name: install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
Expand Down Expand Up @@ -103,35 +103,33 @@ jobs:
elif [ $TEST_LANG == "rswasm" ]; then
go test ./... -rswasm
fi
golangci:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.5
go-version: 1.19.1
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Generate SC files
run: |
cd contracts/wasm/scripts
bash schema_all.sh
# - name: Generate SC files
# run: |
# cd contracts/wasm/scripts
# bash schema_all.sh

- name: golangci-lint in SC
uses: golangci/golangci-lint-action@v3
with:
version: v1.48.0
working-directory: contracts/wasm
args: --fix --timeout 5m0s --path-prefix=""
skip-pkg-cache: true
# - name: golangci-lint in SC
# uses: golangci/golangci-lint-action@v3
# with:
# working-directory: contracts/wasm
# args: --fix --timeout 5m0s --path-prefix=""
# skip-pkg-cache: true

- name: Run global scope golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.48.0
args: --timeout 5m0s
skip-pkg-cache: true
45 changes: 24 additions & 21 deletions .github/workflows/docker-push.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
name: Deploy IOTA Operator on DockerHub
name: Docker Image CI

on:
push:
branches:
- 'master'
tags:
- 'v*'

workflow_dispatch:
release:
types:
- published

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
docker:
name: Build and Push Docker image
runs-on: ubuntu-latest
env:
image_name: iotaledger/wasp

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
- uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
uses: docker/metadata-action@v4
with:
images: iotaledger/wasp
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: BUILD_TAGS=rocksdb,builtin_static,BUILD_LD_FLAGS=-X github.com/iotaledger/wasp/packages/wasp.VersionHash=${{ env. GITHUB_SHA }}
build-args: BUILD_TAGS="rocksdb,builtin_static",BUILD_LD_FLAGS="-X github.com/iotaledger/wasp/packages/wasp.VersionHash=${{ github.sha }}"
115 changes: 88 additions & 27 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
run:
go: "1.18"
tests: true
skip-dirs:
- contracts/wasm

issues:
exclude-use-default: false
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
new-from-rev: ""
exclude:
Expand Down Expand Up @@ -57,8 +66,6 @@ linters-settings:
- octalLiteral
- whyNoLint
- wrapperFunc
goimports:
local-prefixes: ""
gomnd:
settings:
mnd:
Expand All @@ -70,17 +77,68 @@ linters-settings:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
goimports:
local-prefixes: github.com/iotaledger
golint:
min-confidence: 0.9
gocyclo:
min-complexity: 15
staticcheck:
checks: ["all"]
stylecheck:
initialisms:
[
"ACL",
"API",
"ASCII",
"CPU",
"CSS",
"DNS",
"EOF",
"GUID",
"HTML",
"HTTP",
"HTTPS",
"ID",
"IP",
"JSON",
"QPS",
"RAM",
"RPC",
"SLA",
"SMTP",
"SQL",
"SSH",
"TCP",
"TLS",
"TTL",
"UDP",
"UI",
"GID",
"UID",
"UUID",
"URI",
"URL",
"UTF8",
"VM",
"XML",
"XMPP",
"XSRF",
"XSS",
"SIP",
"RTP",
"AMQP",
"DB",
"TS",
]

linters:
disable-all: true
enable:
- bodyclose # Checks whether HTTP response body is closed successfully.
- deadcode # Finds unused code.
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f()).
- dupl # Tool for code clone detection.
# Errcheck is a program for checking for unchecked errors in go programs.
# These unchecked errors can be critical bugs in some cases
- errcheck
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases
- exportloopref # Checks for pointers to enclosing loop variables.
- funlen # Tool for detection of long functions.
- goconst # Finds repeated strings that could be replaced by a constant.
Expand All @@ -93,30 +151,42 @@ linters:
- revive # revive is the newer replacement for golint
- goprintffuncname # Checks that printf-like functions are named with f at the end.
- gosec # Inspects source code for security problems.
# - gosimple # Linter for Go source code that specializes in simplifying a code.
- gosimple # Linter for Go source code that specializes in simplifying a code.
- govet # Vet examines Go source code and reports suspicious constructs.
- ineffassign # Detects when assignments to existing variables are not used.
- misspell # Finds commonly misspelled English words in comments.
- nakedret # Finds naked returns in functions greater than a specified function length.
- noctx # noctx finds sending http request without context.Context.
# - nolintlint # Reports ill-formed or insufficient nolint directives.
# - staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks.
- structcheck # Finds unused struct fields.
- nolintlint # Reports ill-formed or insufficient nolint directives.
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks.
- unconvert # Remove unnecessary type conversions.
- unparam # Reports unused function parameters.
# - unused # Checks Go code for unused constants, variables, functions and types.
- varcheck # Finds unused global variables and constants.
- unused # Checks Go code for unused constants, variables, functions and types.
- whitespace # Tool for detection of leading and trailing whitespace.
- asasalint # check for pass []any as any in variadic func(...any)
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false]
- bidichk # Checks for dangerous unicode character sequences
- contextcheck # check the function whether use a non-inherited context
- decorder # check declaration order and count of types, constants, variables and functions
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds
- goheader # Checks is file header matches to pattern [fast: true, auto-fix: false]
- gomodguard # Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false]
- grouper # An analyzer to analyze expression groups.
- importas # Enforces consistent import aliases [fast: true, auto-fix: false]
- predeclared # find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false]
- rowserrcheck # checks whether Err of rows is checked successfully [fast: true, auto-fix: false]
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: true, auto-fix: false]
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17
- tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: true, auto-fix: false]
- usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library.
- wastedassign # wastedassign finds wasted assignment statements. [fast: true, auto-fix: false]


### `gosimple` `staticcheck` and `unused` are disabled because of issues with go 1.18: https://github.com/golangci/golangci-lint/issues/2649
### nolintlint also disabled while the above ones are disabled, to avoid false positives

# nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]
# don't enable:
# gomnd: An analyzer to detect magic numbers.
# asciicheck: Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false]
# cyclop: checks function and package cyclomatic complexity [fast: true, auto-fix: false]
# depguard: Go linter that checks if package imports are in a list of acceptable packages [fast: true, auto-fix: false]
# durationcheck: check for two durations multiplied together [fast: true, auto-fix: false]
# errorlint: go-errorlint is a source code linter for Go software that can be used to find code that will cause problemswith the error wrapping scheme introduced in Go 1.13. [fast: true, auto-fix: false]
# exhaustive: check exhaustiveness of enum switch statements [fast: true, auto-fix: false]
Expand All @@ -130,27 +200,18 @@ linters:
# godot: Check if comments end in a period [fast: true, auto-fix: true]
# godox: Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
# gofmt: Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
# goheader: Checks is file header matches to pattern [fast: true, auto-fix: false]
# gomodguard: Allow and block list linter for direct Go module dependencies. This is different from depguard where there are different block types for example version constraints and module recommendations. [fast: true, auto-fix: false]
# ifshort: Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false]
# importas: Enforces consistent import aliases [fast: true, auto-fix: false]
# interfacer: Linter that suggests narrower interface types [fast: true, auto-fix: false]
# lll: Reports long lines [fast: true, auto-fix: false]
# makezero: Finds slice declarations with non-zero initial length [fast: true, auto-fix: false]
# maligned: Tool to detect Go structs that would take less memory if their fields were sorted [fast: true, auto-fix: false]
# nestif: Reports deeply nested if statements [fast: true, auto-fix: false]
# nilerr: Finds the code that returns nil even if it checks that the error is not nil. [fast: true, auto-fix: false]
# nlreturn: nlreturn checks for a new line before return and branch statements to increase code clarity [fast: true, auto-fix: false]
# paralleltest: paralleltest detects missing usage of t.Parallel() method in your Go test [fast: true, auto-fix: false]
# prealloc: Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false]
# predeclared: find code that shadows one of Go's predeclared identifiers [fast: true, auto-fix: false]
# rowserrcheck: checks whether Err of rows is checked successfully [fast: true, auto-fix: false]
# scopelint: Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false]
# sqlclosecheck: Checks that sql.Rows and sql.Stmt are closed. [fast: true, auto-fix: false]
# testpackage: linter that makes you use a separate _test package [fast: true, auto-fix: false]
# thelper: thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: true, auto-fix: false]
# tparallel: tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: true, auto-fix: false]
# typecheck: Like the front-end of a Go compiler, parses and type-checks Go code [fast: true, auto-fix: false]
# wastedassign: wastedassign finds wasted assignment statements. [fast: true, auto-fix: false]
# wrapcheck: Checks that errors returned from external packages are wrapped [fast: true, auto-fix: false]
# wsl: Whitespace Linter - Forces you to use empty lines! [fast: true, auto-fix: false]
Loading

0 comments on commit 92af7ce

Please sign in to comment.