Skip to content

Commit

Permalink
ci: introduce sqlite build tag
Browse files Browse the repository at this point in the history
  • Loading branch information
auricom committed Jan 3, 2025
1 parent 8a59b0a commit 332c99d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
###################
#### Build App ####
###################
- name: Build
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2 make build
- name: Build with sqlite backend
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,sqlite make build
- name: Build with rocksdb backend
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,rocksdb make build
Expand Down
12 changes: 10 additions & 2 deletions scripts/build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ ifeq (bls12381,$(findstring bls12381,$(COSMOS_BUILD_OPTIONS)))
build_tags += bls12381
endif

# handle sqlite
ifeq (sqlite,$(findstring sqlite,$(COSMOS_BUILD_OPTIONS)))
CGO_ENABLED=1
ifeq (arm64,$(shell go env GOARCH))
CC=aarch64-linux-gnu-gcc
endif
endif

# benchmark module
ifeq (benchmark,$(findstring benchmark,$(COSMOS_BUILD_OPTIONS)))
build_tags += benchmark
Expand Down Expand Up @@ -128,8 +136,8 @@ build-linux-arm64:

$(BUILD_TARGETS): go.sum $(BUILDDIR)/
cd ${CURRENT_DIR}/${SIMAPP} && \
CC=$(shell if [ "$(shell go env GOARCH)" = "arm64" ]; then echo "aarch64-linux-gnu-gcc"; else echo "gcc"; fi) \
CGO_ENABLED=1 \
$(if $(CGO_ENABLED),CGO_ENABLED=$(CGO_ENABLED)) \
$(if $(CC),CC=$(CC)) \
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...

$(BUILDDIR)/:
Expand Down

0 comments on commit 332c99d

Please sign in to comment.