Skip to content

Commit

Permalink
Merge branch 'v0.3.0-dev' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Jun 15, 2022
2 parents 8ebac95 + 33e646e commit 9bc9a45
Show file tree
Hide file tree
Showing 154 changed files with 7,053 additions and 2,405 deletions.
92 changes: 76 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,80 @@
name: CI
on: [push, pull_request]
on:
push:
branches:
- "master"
pull_request:
branches:
- "**"
types: [opened, synchronize, edited]

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
tests:
if: (github.event.action != 'closed' || github.event.pull_request.merged == true)
strategy:
matrix:
os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: "Build binaries"
run: make all
- name: "Run tests"
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./cover.out
- uses: actions/checkout@v3
- run: |
git submodule update --init --recursive --force
git fetch --no-tags --prune --depth=1 origin +refs/heads/master:refs/remotes/origin/master
- uses: actions/setup-go@v3
with:
go-version: 1.18.x

- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- name: Golang-ci install
if: runner.os == 'Linux'
run: make lintci-deps

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-

- name: Build
run: make all

# TODO: make it work

# - name: Reproducible build test
# run: |
# make geth
# shasum -a256 ./build/bin/geth > bor1.sha256
# make geth
# shasum -a256 ./build/bin/geth > bor2.sha256
# if ! cmp -s bor1.sha256 bor2.sha256; then
# echo >&2 "Reproducible build broken"; cat bor1.sha256; cat bor2.sha256; exit 1
# fi

- name: Lint
if: runner.os == 'Linux'
run: make lint

- name: Test
run: make test

#- name: Data race tests
# run: make test-race

- name: test-integration
run: make test-integration

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./cover.out
29 changes: 0 additions & 29 deletions .github/workflows/dockerimage.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/**/*dapps*
build/_vendor/pkg

cover.out

#*
.#*
*#
Expand Down
155 changes: 146 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,147 @@
# This file configures github.com/golangci/golangci-lint.

run:
go: '1.18'
timeout: 20m
tests: true
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
skip-files:
- core/genesis_alloc.go
- gen_.*.go
- .*_gen.go

linters:
disable-all: true
enable:
- deadcode
- goconst
- goimports
- gosimple
- govet
- ineffassign
- misspell
# - staticcheck
- unconvert
# - unused
- varcheck
- bodyclose
- containedctx
- contextcheck
- decorder
- durationcheck
- errchkjson
- errname
- exhaustive
- exportloopref
- gocognit
- gofmt
# - gomnd
- gomoddirectives
- gosec
- makezero
- nestif
- nilerr
- nilnil
- noctx
#- nosprintfhostport # TODO: do we use IPv6?
- paralleltest
- prealloc
- predeclared
#- promlinter
#- revive
# - tagliatelle
- tenv
- thelper
- tparallel
- unconvert
- unparam
- wsl
#- errorlint causes stack overflow. TODO: recheck after each golangci update

linters-settings:
gofmt:
simplify: true
auto-fix: false

goconst:
min-len: 3 # minimum length of string constant
min-occurrences: 6 # minimum number of occurrences
min-occurrences: 2 # minimum number of occurrences
numbers: true

goimports:
local-prefixes: github.com/ethereum/go-ethereum

nestif:
min-complexity: 5

prealloc:
for-loops: true

gocritic:
# Which checks should be enabled; can't be combined with 'disabled-checks';
# See https://go-critic.github.io/overview#checks-overview
# To check which checks are enabled run `GL_DEBUG=gocritic ./build/bin/golangci-lint run`
# By default list of stable checks is used.
enabled-checks:
- badLock
- filepathJoin
- sortSlice
- sprintfQuotedString
- syncMapLoadAndDelete
- weakCond
- boolExprSimplify
- httpNoBody
- ioutilDeprecated
- nestingReduce
- preferFilepathJoin
- redundantSprint
- stringConcatSimplify
- timeExprSimplify
- typeAssertChain
- yodaStyleExpr
- truncateCmp
- equalFold
- preferDecodeRune
- preferFprint
- preferStringWriter
- preferWriteByte
- sliceClear
#- ruleguard

# Which checks should be disabled; can't be combined with 'enabled-checks'; default is empty
disabled-checks:
- regexpMust
- exitAfterDefer
- dupBranchBody
- singleCaseSwitch
- unlambda
- captLocal
- commentFormatting
- ifElseChain
- importShadow
- builtinShadow

# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- performance
- diagnostic
- opinionated
- style
disabled-tags:
- experimental
govet:
disable:
- deepequalerrors
- fieldalignment
- shadow
- unsafeptr
check-shadowing: true
enable-all: true
settings:
printf:
# Run `go tool vet help printf` to see available settings for `printf` analyzer.
funcs:
- (github.com/ethereum/go-ethereum/log.Logger).Trace
- (github.com/ethereum/go-ethereum/log.Logger).Debug
- (github.com/ethereum/go-ethereum/log.Logger).Info
- (github.com/ethereum/go-ethereum/log.Logger).Warn
- (github.com/ethereum/go-ethereum/log.Logger).Error
- (github.com/ethereum/go-ethereum/log.Logger).Crit

issues:
exclude-rules:
Expand All @@ -48,3 +160,28 @@ issues:
- path: cmd/faucet/
linters:
- deadcode
# Exclude some linters from running on tests files.
- path: test\.go
linters:
- gosec
- unused
- deadcode
- gocritic
- path: cmd/devp2p
linters:
- gosec
- unused
- deadcode
- gocritic
- path: metrics/sample\.go
linters:
- gosec
- gocritic
- path: p2p/simulations
linters:
- gosec
- gocritic
max-issues-per-linter: 0
max-same-issues: 0
#new: true
new-from-rev: origin/master
8 changes: 4 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ release:

builds:
- id: darwin-amd64
main: ./cmd/geth
main: ./cmd/cli
binary: bor
goos:
- darwin
Expand All @@ -22,7 +22,7 @@ builds:
-s -w

- id: darwin-arm64
main: ./cmd/geth
main: ./cmd/cli
binary: bor
goos:
- darwin
Expand All @@ -37,7 +37,7 @@ builds:
-s -w

- id: linux-amd64
main: ./cmd/geth
main: ./cmd/cli
binary: bor
goos:
- linux
Expand All @@ -53,7 +53,7 @@ builds:
-s -w -extldflags "-static"

- id: linux-arm64
main: ./cmd/geth
main: ./cmd/cli
binary: bor
goos:
- linux
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ RUN apt-get update -y && apt-get upgrade -y \

WORKDIR ${BOR_DIR}
COPY . .
RUN make bor-all
RUN make bor

RUN cp build/bin/bor /usr/local/bin/

ENV SHELL /bin/bash
EXPOSE 8545 8546 8547 30303 30303/udp
Expand Down
18 changes: 0 additions & 18 deletions Dockerfile.classic

This file was deleted.

Loading

0 comments on commit 9bc9a45

Please sign in to comment.