Skip to content

Commit

Permalink
github: Build dqlite from LTS branch
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Pelizäus <[email protected]>
  • Loading branch information
roosterfish committed Oct 24, 2024
1 parent 29b7b54 commit d5494a2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ concurrency:

jobs:
code-tests:
env:
CGO_CFLAGS: -I/home/runner/go/deps/dqlite/include/
CGO_LDFLAGS: -L/home/runner/go/deps/dqlite/.libs/
LD_LIBRARY_PATH: /home/runner/go/deps/dqlite/.libs/
CGO_LDFLAGS_ALLOW: (-Wl,-wrap,pthread_create)|(-Wl,-z,now)
name: Code
runs-on: ubuntu-22.04
strategy:
Expand Down Expand Up @@ -39,13 +44,15 @@ jobs:
- name: Install dependencies
run: |
set -eux
sudo add-apt-repository ppa:dqlite/dev -y --no-update
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
libdqlite-dev \
shellcheck
pkg-config autoconf automake libtool make libuv1-dev libsqlite3-dev liblz4-dev
- name: Build dependencies
run: |
set -eux
make deps
- name: Run static analysis
run: |
Expand Down
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
GOMIN=1.22.7
GOPATH ?= $(shell go env GOPATH)
DQLITE_PATH=$(GOPATH)/deps/dqlite
DQLITE_BRANCH=lts-1.17.x

.PHONY: default
default: update-schema

# Build dependencies
.PHONY: deps
deps:
# dqlite (+raft)
@if [ ! -e "$(DQLITE_PATH)" ]; then \
echo "Retrieving dqlite from ${DQLITE_BRANCH} branch"; \
git clone --depth=1 --branch "${DQLITE_BRANCH}" "https://github.com/canonical/dqlite" "$(DQLITE_PATH)"; \
elif [ -e "$(DQLITE_PATH)/.git" ]; then \
echo "Updating existing dqlite branch"; \
cd "$(DQLITE_PATH)"; git pull; \
fi

cd "$(DQLITE_PATH)" && \
autoreconf -i && \
./configure --enable-build-raft && \
make

# Testing targets.
.PHONY: check
check: check-static check-unit check-system
Expand Down

0 comments on commit d5494a2

Please sign in to comment.