reproducible builds (#42)

* initial

* fix

* fix

* fix

* fix

* fix
pull/43/head
Evgeny Danilenko 2 years ago committed by GitHub
parent 805919c413
commit 0acf0db7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      .github/workflows/main.yml
  2. 2
      .gitignore
  3. 5
      Makefile
  4. 15
      build/main.go

@ -46,3 +46,25 @@ jobs:
- name: Run Go Test with race - name: Run Go Test with race
run: go test -race -shuffle=on -timeout 28m ./... run: go test -race -shuffle=on -timeout 28m ./...
reproducible-builds:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Reproducible build test
run: |
make builds-dummy
shasum -a256 ./build/ibft1 | cut -d " " -f 1 > ibft1.sha256
shasum -a256 ./build/ibft2 | cut -d " " -f 1 > ibft2.sha256
if ! cmp ibft1.sha256 ibft2.sha256; then
echo >&2 "Reproducible build broken"; cat ibft1.sha256; cat ibft2.sha256; exit 1
fi

2
.gitignore vendored

@ -1,4 +1,4 @@
bin/ build/
dist/ dist/
# MacOS Leftovers # MacOS Leftovers

@ -1,6 +1,9 @@
.PHONY: lint .PHONY: lint build-dummy
lint: lint:
golangci-lint run -E whitespace -E wsl -E wastedassign -E unconvert -E tparallel -E thelper -E stylecheck -E prealloc \ golangci-lint run -E whitespace -E wsl -E wastedassign -E unconvert -E tparallel -E thelper -E stylecheck -E prealloc \
-E predeclared -E nlreturn -E misspell -E makezero -E lll -E importas -E ifshort -E gosec -E gofmt -E goconst \ -E predeclared -E nlreturn -E misspell -E makezero -E lll -E importas -E ifshort -E gosec -E gofmt -E goconst \
-E forcetypeassert -E dogsled -E dupl -E errname -E errorlint -E nolintlint --timeout 2m -E forcetypeassert -E dogsled -E dupl -E errname -E errorlint -E nolintlint --timeout 2m
builds-dummy:
cd build && go build -o ./ibft1
cd build && go build -o ./ibft2

@ -0,0 +1,15 @@
package main
import (
"fmt"
"io"
"github.com/0xPolygon/go-ibft/core"
)
func main() {
b := core.NewIBFT(nil, nil, nil)
// prevent golang compiler from removing the whole function
fmt.Sprint(io.Discard, b)
}
Loading…
Cancel
Save