Skip to content

Commit 26decf3

Browse files
committed
update github main workflows, linters, configs, docs and readme
Signed-off-by: Pranay Valson <pranay.valson@gmail.com>
1 parent 293a300 commit 26decf3

21 files changed

+1042
-19
lines changed

.github/workflows/build-test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: build-test
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
audit:
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@0.6.0
18+
with:
19+
access_token: ${{ secrets.GITHUB_TOKEN }}
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v2
24+
with:
25+
go-version: 1.22.5
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
30+
- name: Verify dependencies
31+
run: go mod verify
32+
33+
- name: Build all
34+
run: make all
35+
36+
- name: Run tests
37+
run: make test
38+
39+
- name: Upload coverage to Codecov
40+
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
41+
42+
- name: Clean
43+
run: make clean

.github/workflows/docker-image.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: docker-image-ci
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
push-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@0.6.0
18+
with:
19+
access_token: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Login to GitHub Container Registry
21+
if: ${{ !env.ACT }}
22+
uses: docker/login-action@v1
23+
with:
24+
registry: ghcr.io
25+
username: ${{ secrets.CR_USER }}
26+
password: ${{ secrets.CR_PAT }}
27+
28+
- uses: actions/checkout@v2
29+
- name: Build & Publish the Docker image
30+
if: ${{ !env.ACT }}
31+
run: |
32+
docker build . --file Dockerfile --tag ghcr.io/covalenthq/bsp-geth:latest
33+
docker push ghcr.io/covalenthq/bsp-geth:latest
34+
35+
# - name: Start containers
36+
# run: docker-compose -f "docker-compose.yml" up --build --remove-orphans --force-recreate --exit-code-from agent
37+
38+
# - name: Check running bsp-geth
39+
# run: docker inspect bsp-geth
40+
41+
# - name: Check running containers
42+
# run: docker ps
43+
44+
# - name: Stop containers
45+
# if: always()
46+
# run: docker-compose -f "docker-compose.yml" down

.github/workflows/gcr-image.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: gcr-image
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/cancel-workflow-action@0.6.0
18+
with:
19+
access_token: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Login to GCR
21+
uses: docker/login-action@v2
22+
with:
23+
registry: us-docker.pkg.dev
24+
username: _json_key
25+
password: ${{ secrets.GCR_JSON_KEY }}
26+
27+
- uses: actions/checkout@v2
28+
# - uses: satackey/action-docker-layer-caching@v0.0.11
29+
- name: Build & Publish the Docker image
30+
run: |
31+
docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --platform=linux/amd64,linux/arm64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:latest --push

.github/workflows/go.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@ name: i386 linux tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88
workflow_dispatch:
99

1010
jobs:
1111
build:
1212
runs-on: self-hosted
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v2
1515
- name: Set up Go
16-
uses: actions/setup-go@v5
16+
uses: actions/setup-go@v2
1717
with:
18-
go-version: 1.23.0
19-
cache: false
18+
go-version: 1.22.5
2019
- name: Run tests
2120
run: go test -short ./...
2221
env:
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
permissions:
12+
contents: read
13+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
14+
# pull-requests: read
15+
jobs:
16+
golangci-build:
17+
name: Build
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-go@v3
22+
- name: Set up Go 1.22.5
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: 1.22.5
26+
id: go
27+
- run: go version
28+
29+
- name: Lint
30+
run: |
31+
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2
32+
# ./bin/golangci-lint run
33+
34+
# Optional: working directory, useful for monorepos
35+
# working-directory: somedir
36+
37+
# Optional: golangci-lint command line arguments.
38+
# args: --issues-exit-code=0
39+
40+
# Optional: show only new issues if it's a pull request. The default value is `false`.
41+
# only-new-issues: true
42+
43+
# Optional: if set to true then the action will use pre-installed Go.
44+
# skip-go-installation: true
45+
46+
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
47+
# skip-pkg-cache: true
48+
49+
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
50+
# skip-build-cache: true

.github/workflows/hadolint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: dockerfile-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
linter:
14+
name: lint-dockerfile
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: lint dockerfile
19+
uses: brpaz/hadolint-action@master
20+
with:
21+
dockerfile: "Dockerfile"

.github/workflows/tag-release.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: tag-release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
tagged-release:
10+
name: Tagged Release
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- name: Login to GCR
15+
uses: docker/login-action@v2
16+
with:
17+
registry: us-docker.pkg.dev
18+
username: _json_key
19+
password: ${{ secrets.GCR_JSON_KEY }}
20+
21+
- uses: actions/checkout@v2
22+
23+
# - uses: satackey/action-docker-layer-caching@v0.0.11
24+
25+
- name: Set env
26+
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
27+
28+
- name: Build & Publish the Docker image
29+
run: |
30+
docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --platform=linux/amd64,linux/arm64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:stable -t us-docker.pkg.dev/covalent-project/network/bsp-geth:"${{ env.TAG }}" --push
31+
32+
- uses: "marvinpinto/action-automatic-releases@latest"
33+
with:
34+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
35+
draft: false
36+
prerelease: false
37+
files: |
38+
*.zip
39+
*.tar.gz

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,23 @@ profile.cov
4141
# VS Code
4242
.vscode
4343

44+
# dashboard
45+
/dashboard/assets/flow-typed
46+
/dashboard/assets/node_modules
47+
/dashboard/assets/stats.json
48+
/dashboard/assets/bundle.js
49+
/dashboard/assets/bundle.js.map
50+
/dashboard/assets/package-lock.json
51+
52+
**/yarn-error.log
53+
54+
data/
55+
ganache_data/
56+
.env
57+
scripts/
58+
logs/
59+
coverage.out
60+
coverage.txt
4461
tests/spec-tests/
62+
bin/
63+
out/

.hadolint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ignored:
2+
- DL3018
3+
- DL3016
4+
- DL3059

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.23-alpine AS builder
7+
FROM golang:1.22-alpine AS builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

@@ -23,7 +23,7 @@ RUN apk add --no-cache ca-certificates
2323
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
2424

2525
EXPOSE 8545 8546 30303 30303/udp
26-
ENTRYPOINT ["geth"]
26+
ENTRYPOINT ["geth", "--mainnet", "--syncmode", "full", "--datadir", "/root/.ethereum/covalent", "--replication.targets", "redis://localhost:6379/?topic=replication", "--replica.result", "true", "--replica.specimen", "true", "--replica.blob", "true"]
2727

2828
# Add some metadata labels to help programmatic image consumption
2929
ARG COMMIT=""

0 commit comments

Comments
 (0)