This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
forked from ethereum/discv4-crawl
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1 from consensys-vertical-apps/feat/add-pipeline
feat: add pipeline
- Loading branch information
Showing
10 changed files
with
257 additions
and
2 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,3 +1,9 @@ | ||
nodes.json | ||
enrtree-info.json | ||
all.json | ||
Dockerfile | ||
CHANGELOG.md | ||
README.md | ||
|
||
.git | ||
.github |
Validating CODEOWNERS rules …
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 @@ | ||
* @jasonyic |
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,80 @@ | ||
name: release | ||
|
||
permissions: | ||
id-token: write | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "release-**" | ||
|
||
env: | ||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Semantic Release Version | ||
id: semantic | ||
uses: cycjimmy/semantic-release-action@v3 | ||
with: | ||
extra_plugins: | | ||
@semantic-release/changelog@6.0.2 | ||
@semantic-release/git@10.0.1 | ||
dry_run: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
|
||
- name: Build discv4-crawl | ||
if: steps.semantic.outputs.new_release_version != '' | ||
run: make build | ||
env: | ||
VERSION: ${{ steps.semantic.outputs.new_release_version }} | ||
|
||
- name: Set up Docker Buildx | ||
if: steps.semantic.outputs.new_release_version != '' | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Set up QEMU | ||
if: steps.semantic.outputs.new_release_version != '' | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Login to Docker Registry | ||
if: steps.semantic.outputs.new_release_version != '' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build & Publish image | ||
if: steps.semantic.outputs.new_release_version != '' | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
tags: ${{env.DOCKER_REGISTRY}}/staking/discv4-crawl:${{ steps.semantic.outputs.new_release_version }} | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
cache-from: type=gha | ||
#cache-to: type=gha,mode=max | ||
|
||
- name: Semantic Release | ||
if: steps.semantic.outputs.new_release_version != '' | ||
uses: cycjimmy/semantic-release-action@v3 | ||
with: | ||
extra_plugins: | | ||
@semantic-release/changelog@6.0.2 | ||
@semantic-release/git@10.0.1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} |
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,29 @@ | ||
name: reviewdog | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- beta | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- labeled | ||
|
||
jobs: | ||
hadolint: | ||
name: hadolint | ||
runs-on: ubuntu-latest | ||
|
||
if: github.actor != 'dependabot[bot]' || contains(github.event.pull_request.labels.*.name, 'safe-to-test') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: hadolint | ||
uses: reviewdog/action-hadolint@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-check | ||
fail_on_error: true |
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,73 @@ | ||
linters-settings: | ||
govet: | ||
settings: | ||
printf: | ||
funcs: | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | ||
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf | ||
revive: | ||
min-confidence: 0 | ||
gocyclo: | ||
min-complexity: 10 | ||
maligned: | ||
suggest-new: true | ||
dupl: | ||
threshold: 100 | ||
goconst: | ||
min-len: 5 | ||
min-occurrences: 2 | ||
depguard: | ||
list-type: blacklist | ||
packages: | ||
# logging is allowed only by logutils.Log, logrus | ||
# is allowed to use only in logutils package | ||
- github.com/sirupsen/logrus | ||
misspell: | ||
locale: US | ||
lll: | ||
line-length: 140 | ||
gocritic: | ||
enabled-tags: | ||
- performance | ||
- style | ||
- experimental | ||
disabled-checks: | ||
- wrapperFunc | ||
- hugeParam | ||
|
||
linters: | ||
enable: | ||
- goconst | ||
- gocritic | ||
- revive | ||
- govet | ||
- misspell | ||
- stylecheck | ||
- unconvert | ||
- unparam | ||
- gofmt | ||
disable: | ||
- gochecknoinits | ||
|
||
issues: | ||
max-same-issues: 10 | ||
exclude-use-default: true | ||
|
||
run: | ||
deadline: 20m | ||
skip-dirs: | ||
- .gocache | ||
- pkg/go-ethereum | ||
- build | ||
- public | ||
- mock | ||
- scripts | ||
- vendor | ||
- tests | ||
skip-files: | ||
- ".*\\.pb(\\.gw)?\\.go$" | ||
- ".*_test.go$" | ||
- pkg/toolkit/app/http/handler/dashboard/genstatic/gen.go | ||
- pkg/toolkit/app/http/handler/swagger/genstatic/gen.go |
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,14 @@ | ||
ignored: | ||
- DL3018 | ||
- DL3025 | ||
- DL3008 | ||
- DL4006 | ||
- DL3003 | ||
- DL3015 | ||
- SC2086 | ||
- SC1091 | ||
- DL4001 | ||
- SC2046 | ||
|
||
trustedRegistries: | ||
- docker.io |
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,14 @@ | ||
branches: | ||
- main | ||
- name: beta-* | ||
prerelease: true | ||
- name: alpha-* | ||
prerelease: true | ||
plugins: | ||
- "@semantic-release/commit-analyzer" | ||
- "@semantic-release/release-notes-generator" | ||
- "@semantic-release/changelog" | ||
- - "@semantic-release/github" | ||
- assets: | ||
- "build/discv4-crawl" | ||
- "@semantic-release/git" |
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,3 @@ | ||
golang 1.20.7 | ||
golangci-lint 1.52.2 | ||
ginkgo 2.1.3 |
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
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,33 @@ | ||
SHELL := bash | ||
.SHELLFLAGS := -eu -o pipefail -c | ||
.ONESHELL: | ||
MAKEFLAGS += --warn-undefined-variables | ||
MAKEFLAGS += --no-builtin-rules | ||
|
||
|
||
lint: | ||
golangci-lint run | ||
|
||
lint-fix: | ||
golangci-lint run --fix | ||
|
||
.PHONY: vendor | ||
vendor: | ||
go mod tidy | ||
go mod vendor | ||
go mod download | ||
|
||
build-dirs: | ||
@mkdir -p build | ||
|
||
asdf-bootstrap: | ||
asdf plugin update --all | ||
asdf plugin-add golang https://github.com/kennyp/asdf-golang.git || true | ||
asdf plugin-add golangci-lint https://github.com/hypnoglow/asdf-golangci-lint.git || true | ||
asdf plugin-add ginkgo https://github.com/jimmidyson/asdf-ginkgo.git || true | ||
NODEJS_CHECK_SIGNATURES=no asdf install | ||
|
||
.PHONY: docker | ||
docker: | ||
# for multiple platform: --platform linux/amd64,linux/arm64 | ||
docker buildx build -t staking/discv4-crawl . --load |