Skip to content

Commit 72ec430

Browse files
committed
chore: move build and common source files to root
1 parent 1ea0262 commit 72ec430

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1424
-1465
lines changed

.github/workflows/bridge.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Bridge
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
paths:
9+
- 'bridge/**'
10+
- '.github/workflows/bridge.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- staging
15+
paths:
16+
- 'bridge/**'
17+
- '.github/workflows/bridge.yml'
18+
19+
defaults:
20+
run:
21+
working-directory: 'bridge'
22+
23+
jobs:
24+
check:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Install Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.17.x
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
- name: Lint
34+
run: |
35+
rm -rf $HOME/.cache/golangci-lint
36+
make lint
37+
goimports-lint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Install Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: 1.17.x
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
- name: Install goimports
47+
run: |
48+
go get golang.org/x/tools/cmd/goimports
49+
- run: goimports -local scroll-tech/bridge/ -w .
50+
- run: go mod tidy -compat=1.17
51+
# If there are any diffs from goimports or go mod tidy -compat=1.17, fail.
52+
- name: Verify no changes from goimports and go mod tidy -compat=1.17
53+
run: |
54+
if [ -n "$(git status --porcelain)" ]; then
55+
exit 1
56+
fi
File renamed without changes.

coordinator/.github/workflows/scroll_ci.yml renamed to .github/workflows/coordinator.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
1-
on: [pull_request]
2-
name: Continuous Integration
1+
name: Coordinator
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
paths:
9+
- 'coordinator/**'
10+
- '.github/workflows/coordinator.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- staging
15+
paths:
16+
- 'coordinator/**'
17+
- '.github/workflows/coordinator.yml'
18+
19+
defaults:
20+
run:
21+
working-directory: 'coordinator'
22+
323
jobs:
424
check:
525
runs-on: ubuntu-latest
@@ -21,14 +41,14 @@ jobs:
2141
uses: actions/setup-go@v2
2242
with:
2343
go-version: 1.17.x
24-
- name: Install goimports
25-
run: go get golang.org/x/tools/cmd/goimports
2644
- name: Checkout code
2745
uses: actions/checkout@v2
46+
- name: Install goimports
47+
run: go get golang.org/x/tools/cmd/goimports
2848
- run: goimports -local scroll-tech/coordinator/ -w .
29-
- run: go mod tidy
30-
# If there are any diffs from goimports or go mod tidy, fail.
31-
- name: Verify no changes from goimports and go mod tidy
49+
- run: go mod tidy -compat=1.17
50+
# If there are any diffs from goimports or go mod tidy -compat=1.17, fail.
51+
- name: Verify no changes from goimports and go mod tidy -compat=1.17
3252
run: |
3353
if [ -n "$(git status --porcelain)" ]; then
3454
exit 1

.github/workflows/internal.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Internal
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
paths:
9+
- 'internal/**'
10+
- '.github/workflows/internal.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- staging
15+
paths:
16+
- 'internal/**'
17+
- '.github/workflows/internal.yml'
18+
19+
defaults:
20+
run:
21+
working-directory: 'internal'
22+
23+
jobs:
24+
check:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Install Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.17.x
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
- name: Lint
34+
run: |
35+
rm -rf $HOME/.cache/golangci-lint
36+
make lint
37+
goimports-lint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Install Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: 1.17.x
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
- name: Install goimports
47+
run: |
48+
go get golang.org/x/tools/cmd/goimports
49+
- run: goimports -local scroll-tech/internal/ -w .
50+
- run: go mod tidy -compat=1.17
51+
# If there are any diffs from goimports or go mod tidy -compat=1.17, fail.
52+
- name: Verify no changes from goimports and go mod tidy -compat=1.17
53+
run: |
54+
if [ -n "$(git status --porcelain)" ]; then
55+
exit 1
56+
fi

.github/workflows/roller.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,12 @@ jobs:
7777
- name: Checkout code
7878
uses: actions/checkout@v2
7979
- name: Install goimports
80-
run: go get golang.org/x/tools/cmd/goimports
80+
run: |
81+
go get golang.org/x/tools/cmd/goimports
8182
- run: goimports -local scroll-tech/go-roller/ -w .
82-
- run: go mod tidy
83-
# If there are any diffs from goimports or go mod tidy, fail.
84-
- name: Verify no changes from goimports and go mod tidy
83+
- run: go mod tidy -compat=1.17
84+
# If there are any diffs from goimports or go mod tidy -compat=1.17, fail.
85+
- name: Verify no changes from goimports and go mod tidy -compat=1.17
8586
run: |
8687
if [ -n "$(git status --porcelain)" ]; then
8788
exit 1

.github/workflows/store.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Store
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
paths:
9+
- 'store/**'
10+
- '.github/workflows/store.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- staging
15+
paths:
16+
- 'store/**'
17+
- '.github/workflows/store.yml'
18+
19+
defaults:
20+
run:
21+
working-directory: 'store'
22+
23+
jobs:
24+
check:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Install Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.17.x
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
- name: Lint
34+
run: |
35+
rm -rf $HOME/.cache/golangci-lint
36+
make lint
37+
goimports-lint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Install Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: 1.17.x
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
- name: Install goimports
47+
run: |
48+
go get golang.org/x/tools/cmd/goimports
49+
- run: goimports -local scroll-tech/store/ -w .
50+
- run: go mod tidy -compat=1.17
51+
# If there are any diffs from goimports or go mod tidy -compat=1.17, fail.
52+
- name: Verify no changes from goimports and go mod tidy -compat=1.17
53+
run: |
54+
if [ -n "$(git status --porcelain)" ]; then
55+
exit 1
56+
fi

.github/workflows/utils.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Utils
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- staging
8+
paths:
9+
- 'utils/**'
10+
- '.github/workflows/utils.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
- staging
15+
paths:
16+
- 'utils/**'
17+
- '.github/workflows/utils.yml'
18+
19+
defaults:
20+
run:
21+
working-directory: 'utils'
22+
23+
jobs:
24+
check:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Install Go
28+
uses: actions/setup-go@v2
29+
with:
30+
go-version: 1.17.x
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
- name: Lint
34+
run: |
35+
rm -rf $HOME/.cache/golangci-lint
36+
make lint
37+
goimports-lint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Install Go
41+
uses: actions/setup-go@v2
42+
with:
43+
go-version: 1.17.x
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
- name: Install goimports
47+
run: |
48+
go get golang.org/x/tools/cmd/goimports
49+
- run: goimports -local scroll-tech/utils/ -w .
50+
- run: go mod tidy -compat=1.17
51+
# If there are any diffs from goimports or go mod tidy -compat=1.17, fail.
52+
- name: Verify no changes from goimports and go mod tidy -compat=1.17
53+
run: |
54+
if [ -n "$(git status --porcelain)" ]; then
55+
exit 1
56+
fi

bridge/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/build/bin
22
.idea
3-
bridge/contracts
3+
contracts

bridge/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Build bridge in a stock Go builder container
22
FROM scrolltech/go-builder:1.17 as builder
33

4-
ADD ./bridge /bridge
5-
ADD ./store /store
4+
COPY ./bridge /bridge
5+
COPY ./store /store
6+
COPY ./utils /utils
67

7-
RUN cd /bridge/cmd/bridge/ && go build -v -p 4
8+
RUN cd /bridge/cmd/ && go build -v -p 4
89

910
# Pull bridge into a second stage deploy alpine container
1011
FROM alpine:latest
1112

12-
COPY --from=builder /bridge/cmd/bridge /bin/
13+
COPY --from=builder /bridge/cmd /bin/
1314

1415
EXPOSE 8645
1516
ENTRYPOINT ["bridge"]

bridge/Jenkinsfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ pipeline {
3030
//sh '''cat $PWD/logs/geth.log'''
3131
sh '''
3232
go get ./...
33-
go test -v -race -coverprofile=coverage.txt -covermode=atomic $(go list ./... | grep -v 'bridge')
34-
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/bridge/abi
35-
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/bridge/l1
36-
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/bridge/l2
37-
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/bridge/sender
33+
go test -v -race -coverprofile=coverage.txt -covermode=atomic $(go list ./...)
34+
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/abi
35+
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/l1
36+
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/l2
37+
go test -v -race -coverprofile=coverage.txt -covermode=atomic -p 1 scroll-tech/bridge/sender
3838
'''
3939
}
4040
}

0 commit comments

Comments
 (0)