Skip to content

Commit f96f611

Browse files
committed
feat: add go/batch-submitter Makefile and actions runners
1 parent 6590912 commit f96f611

6 files changed

Lines changed: 86 additions & 2 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: batch-submitter unit tests
2+
3+
on:
4+
push:
5+
paths:
6+
- 'go/batch-submitter/**'
7+
branches:
8+
- 'master'
9+
- 'develop'
10+
- '*rc'
11+
- 'regenesis/*'
12+
pull_request:
13+
paths:
14+
- 'go/batch-submitter/*'
15+
branches:
16+
- 'master'
17+
- 'develop'
18+
- '*rc'
19+
- 'regenesis/*'
20+
workflow_dispatch:
21+
22+
defaults:
23+
run:
24+
working-directory: './go/batch-submitter'
25+
26+
jobs:
27+
tests:
28+
runs-on: ubuntu-latest
29+
30+
steps:
31+
- name: Install Go
32+
uses: actions/setup-go@v2
33+
with:
34+
go-version: 1.16.x
35+
36+
- name: Checkout code
37+
uses: actions/checkout@v2
38+
39+
- name: Install
40+
run: make
41+
42+
- name: Test
43+
run: make test

.github/workflows/golangci-lint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
paths:
55
- 'go/gas-oracle/**'
6+
- 'go/batch-submitter/**'
67
branches:
78
- 'master'
89
- 'develop'
@@ -11,6 +12,7 @@ on:
1112
pull_request:
1213
paths:
1314
- 'go/gas-oracle/**'
15+
- 'go/batch-submitter/**'
1416
branches:
1517
- 'master'
1618
- 'develop'
@@ -22,8 +24,13 @@ jobs:
2224
runs-on: ubuntu-latest
2325
steps:
2426
- uses: actions/checkout@v2
25-
- name: golangci-lint
27+
- name: golangci-lint gas-oracle
2628
uses: golangci/golangci-lint-action@v2
2729
with:
2830
version: v1.29
2931
working-directory: go/gas-oracle
32+
- name: golangci-lint batch-submitter
33+
uses: golangci/golangci-lint-action@v2
34+
with:
35+
version: v1.29
36+
working-directory: go/batch-submitter

go/batch-submitter/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/batch-submitter

go/batch-submitter/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
GITCOMMIT := $(shell git rev-parse HEAD)
2+
GITDATE := $(shell git show -s --format='%ct')
3+
GITVERSION := $(shell cat package.json | jq .version)
4+
5+
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
6+
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
7+
LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION)
8+
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
9+
10+
batch-submitter:
11+
env GO111MODULE=on go build $(LDFLAGS) ./cmd/batch-submitter
12+
13+
clean:
14+
rm batch-submitter
15+
16+
test:
17+
go test -v ./...
18+
19+
lint:
20+
golangci-lint run ./...
21+
22+
.PHONY: \
23+
batch-submitter \
24+
clean \
25+
test \
26+
lint

go/batch-submitter/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "@eth-optimism/batch-submitter-service",
3+
"version": "0.0.1",
4+
"private": true,
5+
"devDependencies": {}
6+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"l2geth",
1010
"integration-tests",
1111
"specs",
12-
"go/gas-oracle"
12+
"go/gas-oracle",
13+
"go/batch-submitter"
1314
],
1415
"nohoist": [
1516
"examples/*"

0 commit comments

Comments
 (0)