Skip to content

Commit 1ae79ab

Browse files
committed
change build action
Signed-off-by: Fedor Partanskiy <[email protected]>
1 parent 7a86629 commit 1ae79ab

File tree

7 files changed

+647
-931
lines changed

7 files changed

+647
-931
lines changed

.github/workflows/build.yml

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

33
on:
4+
push:
5+
branches: [ "**" ]
46
pull_request:
7+
branches: [ "**" ]
8+
workflow_dispatch:
59

610
jobs:
7-
811
build:
912
runs-on: ubuntu-latest
1013
steps:
@@ -14,7 +17,7 @@ jobs:
1417
- name: Install Go
1518
uses: actions/setup-go@v5
1619
with:
17-
go-version: 1.22.4
20+
go-version: 1.24.1
1821

1922
- name: Prepare Env
2023
run: bash scripts/prepare_environ.sh

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ all:
55
bash ./scripts/build_checks.sh
66
protos:
77
protoc --go_opt=paths=source_relative --go_out=. smartbftprotos/*.proto
8-
find . -name "*.pb.go" | grep -v "^./vendor" | xargs goimports -w
8+
protoc --go_opt=paths=source_relative --go_out=. examples/naive_chain/*.proto
9+
protoc --go_opt=paths=source_relative --go_out=. test/*.proto

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: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ err() {
1010

1111
echo -e "\nTesting commit: ------${ANSI_GREEN}" $(git log -1 --no-merges | head -$(( $(git log -1 --no-merges | wc -l) - 2 )) | tail -1) "${ANSI_RESET}------\n"
1212

13-
go get -u golang.org/x/tools/cmd/goimports
14-
go get -u google.golang.org/protobuf/cmd/protoc-gen-go
15-
13+
go install golang.org/x/tools/cmd/goimports@latest
14+
go install google.golang.org/protobuf/cmd/[email protected]
1615

1716
BUILDDIR=.build
1817
if [ ! -d "$BUILDDIR" ]; then
1918
mkdir $BUILDDIR
2019
fi
2120
cd $BUILDDIR
2221

23-
PROTOC_ZIP=protoc-3.8.0-linux-x86_64.zip
22+
PROTOC_VER=29.3
23+
PROTOC_ZIP=protoc-$PROTOC_VER-linux-x86_64.zip
2424
if [ ! -f "$PROTOC_ZIP" ]; then
2525
echo "$PROTOC_ZIP does not exist"
26-
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.12.3/protoc-3.12.3-linux-x86_64.zip
27-
unzip protoc-3.12.3-linux-x86_64.zip
26+
wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VER/$PROTOC_ZIP
27+
unzip $PROTOC_ZIP
2828
fi
2929

3030
export PATH=$PATH:$BUILDDIR/bin/
@@ -52,13 +52,13 @@ else
5252
fi
5353

5454
make protos
55-
# git status | grep "pb.go" | grep -q "modified"
56-
# if [ $? -eq 0 ];then
57-
# git status
58-
# err "protobuf not up to date"
59-
# git diff
60-
# exit 1
61-
# fi
55+
git status | grep "pb.go" | grep -q "modified"
56+
if [ $? -eq 0 ];then
57+
git status
58+
err "protobuf not up to date"
59+
git diff
60+
exit 1
61+
fi
6262

6363
( sleep 600; ps -ef | grep test | grep -v "go test" | grep -v grep | awk '{print $2}' | xargs kill -SIGABRT ) &
6464

0 commit comments

Comments
 (0)