-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #590 from semyon-dev/dev
refactoring, better build scripts
- Loading branch information
Showing
77 changed files
with
744 additions
and
638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,44 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: [ "master" ] | ||
# pull_request: | ||
# branches: [ "master" ] | ||
branches: [ "master", "dev" ] | ||
pull_request: | ||
branches: [ "dev" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore | ||
|
||
jobs: | ||
run_build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: clone repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: download and install | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.2' | ||
go-version: '1.22.5' | ||
|
||
- name: protobuff install | ||
run: | | ||
sudo apt update | ||
sudo apt install protobuf-compiler | ||
- name: go_ins_1 | ||
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
- name: install protoc (protobuf) | ||
uses: arduino/setup-protoc@v3 | ||
with: | ||
version: v27.2 | ||
include-pre-releases: false | ||
|
||
- name: go_ins_2 | ||
run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
- name: chmod +x | ||
run: chmod +x ./scripts/install_deps && chmod +x ./scripts/build | ||
|
||
- name: generate | ||
run: go generate ./... | ||
- name: install dependencies | ||
run: ./scripts/install_deps | ||
|
||
- name: check version | ||
run: go version | ||
- name: build linux | ||
run: ./scripts/build linux amd64 dev | ||
|
||
- name: check folder | ||
run: ls | ||
- name: build darwin | ||
run: ./scripts/build darwin amd64 dev | ||
|
||
- name: do build | ||
run: go build snetd/main.go | ||
- name: build windows | ||
run: ./scripts/build windows amd64 dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,37 @@ | ||
name: tests | ||
on: | ||
# push: | ||
# branches: [ "master" ] | ||
push: | ||
branches: [ "dev" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
branches: [ "master", "dev" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
GOLANG_PROTOBUF_REGISTRATION_CONFLICT: ignore | ||
|
||
jobs: | ||
run_tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: clone repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: download and install | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.2' | ||
|
||
- name: protobuff install | ||
run: | | ||
sudo apt update | ||
sudo apt install protobuf-compiler | ||
go-version: '1.22.5' | ||
|
||
- name: go_ins_1 | ||
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||
|
||
- name: go_ins_2 | ||
run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||
|
||
- name: generate | ||
run: go generate ./... | ||
- name: install protoc (protobuf) | ||
uses: arduino/setup-protoc@v3 | ||
with: | ||
version: v27.2 | ||
include-pre-releases: false | ||
|
||
- name: check version | ||
run: go version | ||
- name: chmod to allow run script | ||
run: chmod +x ./scripts/install_deps | ||
|
||
- name: check folder | ||
run: ls | ||
- name: install dependencies | ||
run: ./scripts/install_deps | ||
|
||
- name: do tests | ||
- name: go tests | ||
run: go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,49 @@ | ||
# idea cache | ||
.idea/ | ||
|
||
# npm cache and configs | ||
# npm cache | ||
resources/blockchain/package-lock.json | ||
resources/blockchain/node_modules/ | ||
resources/blockchain/build/ | ||
snetd.db | ||
|
||
# configs | ||
snetd.config.json | ||
/vendor/ | ||
/build/ | ||
resources/blockchain/package-lock.json | ||
|
||
# Autogenerated sources | ||
# autogenerated sources | ||
blockchain/snet-contracts.go | ||
*.pb.go | ||
/vendor/ | ||
|
||
# Binaries for programs and plugins | ||
# binaries for programs and plugins | ||
/build/ | ||
*.exe | ||
*.exe~ | ||
*.dll | ||
*.so | ||
*.dylib | ||
|
||
# Test binary, build with `go test -c` | ||
# test binary, build with `go test -c` | ||
*.test | ||
|
||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
# output of the go coverage tool, specifically when used with LiteIDE | ||
*.out | ||
|
||
# vim temporary files | ||
*~ | ||
*.swp | ||
*.swo | ||
|
||
# etcd server temporary directories | ||
# etcd server directories | ||
storage-* | ||
*.pem | ||
*log | ||
data.etcd/ | ||
*.tmp | ||
*.etcd | ||
|
||
# certs and keys | ||
*.pem | ||
|
||
# logs | ||
*.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This file configures github.com/golangci/golangci-lint. | ||
|
||
run: | ||
concurrency: 4 | ||
timeout: 5m | ||
tests: false | ||
issues-exit-code: 3 | ||
modules-download-mode: readonly | ||
allow-parallel-runners: true | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- unconvert | ||
- typecheck | ||
# - unused | ||
- staticcheck | ||
- bidichk | ||
- durationcheck | ||
- exportloopref | ||
- whitespace | ||
- revive # only certain checks enabled | ||
|
||
linters-settings: | ||
gofmt: | ||
simplify: true | ||
revive: | ||
enable-all-rules: false | ||
# here we enable specific useful rules | ||
# see https://golangci-lint.run/usage/linters/#revive for supported rules | ||
rules: | ||
- name: receiver-naming | ||
severity: warning | ||
disabled: false | ||
exclude: [ "" ] | ||
|
||
issues: | ||
exclude-dirs-use-default: true | ||
exclude-dirs: | ||
- bin | ||
- build | ||
- \.git | ||
exclude-files: | ||
- ".pb" | ||
exclude-rules: | ||
- linters: | ||
- lll | ||
source: "^//go:generate " |
Oops, something went wrong.