Skip to content

Commit 1728831

Browse files
pfi79C0rWin
andauthored
change build action (#616)
Signed-off-by: Fedor Partanskiy <[email protected]> Co-authored-by: C0rWin <[email protected]>
1 parent e7e0f1a commit 1728831

File tree

9 files changed

+685
-1023
lines changed

9 files changed

+685
-1023
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,66 @@
11
name: Build
22

33
on:
4+
push:
5+
branches: [ "**" ]
46
pull_request:
7+
branches: [ "**" ]
8+
workflow_dispatch:
9+
10+
env:
11+
GO_VER: 1.24.1
12+
PROTOC_VER: 29.3
13+
PROTOC_GEN_GO_VER: v1.36.5
514

615
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
name: Checkout Code
21+
22+
- name: Install Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: ${{ env.GO_VER }}
26+
27+
- name: Install Protoc
28+
uses: arduino/setup-protoc@v3
29+
with:
30+
version: ${{ env.PROTOC_VER }}
31+
32+
- name: check go.mod
33+
run: |
34+
go mod tidy
35+
git diff --exit-code go.mod
36+
37+
- name: check vendor
38+
run: |
39+
go mod vendor
40+
git diff --exit-code
41+
42+
- name: go fmt
43+
run: |
44+
go fmt ./...
45+
git diff --exit-code
46+
47+
- name: goimports
48+
run: |
49+
go install golang.org/x/tools/cmd/goimports@latest
50+
goimports -l -w `find . -name '*.go' | grep -v vendor | grep -v 'pb.go'`
51+
git diff --exit-code
52+
53+
- name: check protobuf
54+
run: |
55+
go install google.golang.org/protobuf/cmd/protoc-gen-go@${{ env.PROTOC_GEN_GO_VER }}
56+
protoc --go_opt=paths=source_relative --go_out=. smartbftprotos/*.proto
57+
protoc --go_opt=paths=source_relative --go_out=. examples/naive_chain/*.proto
58+
protoc --go_opt=paths=source_relative --go_out=. test/*.proto
59+
git diff --exit-code
760
861
build:
62+
needs:
63+
- validate
964
runs-on: ubuntu-latest
1065
steps:
1166
- uses: actions/checkout@v4
@@ -14,15 +69,8 @@ jobs:
1469
- name: Install Go
1570
uses: actions/setup-go@v5
1671
with:
17-
go-version: 1.22.4
18-
19-
- name: Prepare Env
20-
run: bash scripts/prepare_environ.sh
72+
go-version: ${{ env.GO_VER }}
2173

2274
- name: Test
23-
working-directory: /home/runner/go/src/github.com/hyperledger-labs/SmartBFT
24-
run: make all
25-
26-
- name: Post
27-
working-directory: /home/runner/go/src/github.com/hyperledger-labs/SmartBFT
28-
run: ./scripts/post.sh
75+
run: |
76+
go test -count 1 -race ./...

Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

examples/naive_chain/test_message.pb.go

Lines changed: 48 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/build_checks.sh

Lines changed: 0 additions & 75 deletions
This file was deleted.

scripts/post.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/prepare_environ.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)