Skip to content

change build action #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 58 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,66 @@
name: Build

on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:

env:
GO_VER: 1.24.1
PROTOC_VER: 29.3
PROTOC_GEN_GO_VER: v1.36.5

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Code

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VER }}

- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: ${{ env.PROTOC_VER }}

- name: check go.mod
run: |
go mod tidy
git diff --exit-code go.mod

- name: check vendor
run: |
go mod vendor
git diff --exit-code

- name: go fmt
run: |
go fmt ./...
git diff --exit-code

- name: goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
goimports -l -w `find . -name '*.go' | grep -v vendor | grep -v 'pb.go'`
git diff --exit-code

- name: check protobuf
run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@${{ env.PROTOC_GEN_GO_VER }}
protoc --go_opt=paths=source_relative --go_out=. smartbftprotos/*.proto
protoc --go_opt=paths=source_relative --go_out=. examples/naive_chain/*.proto
protoc --go_opt=paths=source_relative --go_out=. test/*.proto
git diff --exit-code

build:
needs:
- validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -14,15 +69,8 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.4

- name: Prepare Env
run: bash scripts/prepare_environ.sh
go-version: ${{ env.GO_VER }}

- name: Test
working-directory: /home/runner/go/src/github.com/hyperledger-labs/SmartBFT
run: make all

- name: Post
working-directory: /home/runner/go/src/github.com/hyperledger-labs/SmartBFT
run: ./scripts/post.sh
run: |
go test -count 1 -race ./...
8 changes: 0 additions & 8 deletions Makefile

This file was deleted.

112 changes: 48 additions & 64 deletions examples/naive_chain/test_message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

75 changes: 0 additions & 75 deletions scripts/build_checks.sh

This file was deleted.

5 changes: 0 additions & 5 deletions scripts/post.sh

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/prepare_environ.sh

This file was deleted.

Loading