diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8dab3a3a7..e150254462 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: - ready_for_review name: CI jobs: - build: + build-mock-ccc-geth: # build geth with mock circuit capacity checker if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: @@ -26,6 +26,28 @@ jobs: uses: actions/checkout@v2 - name: Build run: | + make nccc_geth + build-geth: # build geth with circuit capacity checker + if: github.event_name == 'push' # will only be triggered when pushing to main & staging & develop & alpha + runs-on: ubuntu-latest + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: 1.20.x + - name: Install rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly-2022-12-10 + override: true + components: rustfmt, clippy + - name: Checkout code + uses: actions/checkout@v2 + - name: Build + run: | + make libzkp + sudo cp ./rollup/circuitcapacitychecker/libzkp/libzkp.so /usr/local/lib/ + sudo cp ./rollup/circuitcapacitychecker/libzkp/libzktrie.so /usr/local/lib/ make geth # check: # if: github.event.pull_request.draft == false diff --git a/Makefile b/Makefile index d736ef61c0..1e7bc8ac09 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,25 @@ # with Go source code. If you know what GOPATH is then you probably # don't need to bother with make. -.PHONY: geth android ios evm all test clean +.PHONY: geth android ios evm all test clean libzkp GOBIN = ./build/bin GO ?= latest GORUN = go run -geth: +libzkp: + cd $(PWD)/rollup/circuitcapacitychecker/libzkp && make libzkp + +nccc_geth: ## geth without circuit capacity checker $(GORUN) build/ci.go install ./cmd/geth @echo "Done building." @echo "Run \"$(GOBIN)/geth\" to launch geth." +geth: libzkp ## geth with circuit capacity checker + $(GORUN) build/ci.go install -tags circuit_capacity_checker ./cmd/geth + @echo "Done building." + @echo "Run \"$(GOBIN)/geth\" to launch geth." + all: $(GORUN) build/ci.go install diff --git a/build/ci.go b/build/ci.go index f3f49bc847..69ff54beb1 100644 --- a/build/ci.go +++ b/build/ci.go @@ -186,10 +186,11 @@ func main() { func doInstall(cmdline []string) { var ( - dlgo = flag.Bool("dlgo", false, "Download Go and build with it") - arch = flag.String("arch", "", "Architecture to cross build for") - cc = flag.String("cc", "", "C compiler to cross build with") - staticlink = flag.Bool("static", false, "Create statically-linked executable") + dlgo = flag.Bool("dlgo", false, "Download Go and build with it") + arch = flag.String("arch", "", "Architecture to cross build for") + cc = flag.String("cc", "", "C compiler to cross build with") + staticlink = flag.Bool("static", false, "Create statically-linked executable") + gobuildtags = flag.String("tags", "", "Tags for go build") ) flag.CommandLine.Parse(cmdline) env := build.Env() @@ -208,6 +209,10 @@ func doInstall(cmdline []string) { buildTags = append(buildTags, "ckzg") } + if len(*gobuildtags) > 0 { + buildTags = append(buildTags, strings.Split(*gobuildtags, ",")...) + } + // Configure the build. gobuild := tc.Go("build", buildFlags(env, *staticlink, buildTags)...)