mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-07-30 06:53:35 +00:00
ci: cache libwaku, gate go mod tidy, rename LMN_DIR
- Rename LMN_DIR -> LOGOS_DELIVERY_DIR across the PR-gate and nightly workflows, the waku Makefile, and the build docs. - Cache the built logos-delivery kernel keyed on its upstream HEAD SHA, skipping the clone + libwaku build while that commit is unchanged. - Add a "go mod tidy is clean" step that fails if go.mod/go.sum drift. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4e4a00d574
commit
857b0908f9
12
.github/workflows/CI.yml
vendored
12
.github/workflows/CI.yml
vendored
@ -46,9 +46,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Build waku bindings
|
- name: Build waku bindings
|
||||||
run: |
|
run: |
|
||||||
export LMN_DIR=$(pwd)/vendor/logos-delivery
|
export LOGOS_DELIVERY_DIR=$(pwd)/vendor/logos-delivery
|
||||||
export CGO_CFLAGS="-I${LMN_DIR}/library/"
|
export CGO_CFLAGS="-I${LOGOS_DELIVERY_DIR}/library/"
|
||||||
export CGO_LDFLAGS="-L${LMN_DIR}/build/ -lwaku -Wl,-rpath,${LMN_DIR}/build/"
|
export CGO_LDFLAGS="-L${LOGOS_DELIVERY_DIR}/build/ -lwaku -Wl,-rpath,${LOGOS_DELIVERY_DIR}/build/"
|
||||||
make -C waku build
|
make -C waku build
|
||||||
|
|
||||||
- name: Increase ulimit
|
- name: Increase ulimit
|
||||||
@ -58,9 +58,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd waku
|
cd waku
|
||||||
export LMN_DIR=$(pwd)/vendor/logos-delivery
|
export LOGOS_DELIVERY_DIR=$(pwd)/vendor/logos-delivery
|
||||||
export CGO_CFLAGS="-I${LMN_DIR}/library/"
|
export CGO_CFLAGS="-I${LOGOS_DELIVERY_DIR}/library/"
|
||||||
export CGO_LDFLAGS="-L${LMN_DIR}/build/ -lwaku -Wl,-rpath,${LMN_DIR}/build/"
|
export CGO_LDFLAGS="-L${LOGOS_DELIVERY_DIR}/build/ -lwaku -Wl,-rpath,${LOGOS_DELIVERY_DIR}/build/"
|
||||||
go test -count=10 -p=1 -v -timeout=360m . | tee ../testlogs.log
|
go test -count=10 -p=1 -v -timeout=360m . | tee ../testlogs.log
|
||||||
|
|
||||||
- name: Upload daily test logs
|
- name: Upload daily test logs
|
||||||
|
|||||||
32
.github/workflows/pr.yml
vendored
32
.github/workflows/pr.yml
vendored
@ -16,7 +16,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
# Clone the logos-delivery checkout OUTSIDE the module tree: a directory
|
# Clone the logos-delivery checkout OUTSIDE the module tree: a directory
|
||||||
# named `vendor/` at the module root would put Go into vendor mode.
|
# named `vendor/` at the module root would put Go into vendor mode.
|
||||||
LMN_DIR: ${{ github.workspace }}/.logos-delivery
|
LOGOS_DELIVERY_DIR: ${{ github.workspace }}/.logos-delivery
|
||||||
# libwaku (kernel) is required at compile time for the cgo packages.
|
# libwaku (kernel) is required at compile time for the cgo packages.
|
||||||
# Updated to also include liblogosdelivery once the messaging package lands.
|
# Updated to also include liblogosdelivery once the messaging package lands.
|
||||||
CGO_CFLAGS: -I${{ github.workspace }}/.logos-delivery/library/
|
CGO_CFLAGS: -I${{ github.workspace }}/.logos-delivery/library/
|
||||||
@ -35,11 +35,29 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: "1.24"
|
go-version: "1.24"
|
||||||
|
|
||||||
|
- name: Resolve logos-delivery commit
|
||||||
|
# Cache the built kernel keyed on the exact upstream commit, so the
|
||||||
|
# expensive clone + build is skipped while logos-delivery's HEAD is
|
||||||
|
# unchanged. ls-remote gives us the SHA before we clone.
|
||||||
|
id: logos-delivery-rev
|
||||||
|
run: |
|
||||||
|
rev=$(git ls-remote https://github.com/logos-messaging/logos-delivery.git HEAD | cut -f1)
|
||||||
|
echo "rev=$rev" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Cache logos-delivery build
|
||||||
|
id: logos-delivery-cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ${{ env.LOGOS_DELIVERY_DIR }}
|
||||||
|
key: logos-delivery-${{ runner.os }}-${{ steps.logos-delivery-rev.outputs.rev }}
|
||||||
|
|
||||||
- name: Clone logos-delivery
|
- name: Clone logos-delivery
|
||||||
run: git clone --depth 1 https://github.com/logos-messaging/logos-delivery.git "$LMN_DIR"
|
if: steps.logos-delivery-cache.outputs.cache-hit != 'true'
|
||||||
|
run: git clone --depth 1 https://github.com/logos-messaging/logos-delivery.git "$LOGOS_DELIVERY_DIR"
|
||||||
|
|
||||||
- name: Build libwaku
|
- name: Build libwaku
|
||||||
run: make -C "$LMN_DIR" libwaku -j
|
if: steps.logos-delivery-cache.outputs.cache-hit != 'true'
|
||||||
|
run: make -C "$LOGOS_DELIVERY_DIR" libwaku -j
|
||||||
|
|
||||||
- name: go build
|
- name: go build
|
||||||
run: go build ./...
|
run: go build ./...
|
||||||
@ -47,6 +65,14 @@ jobs:
|
|||||||
- name: go vet
|
- name: go vet
|
||||||
run: go vet ./...
|
run: go vet ./...
|
||||||
|
|
||||||
|
- name: go mod tidy is clean
|
||||||
|
# `go mod tidy` must be a no-op on a well-maintained module. If it
|
||||||
|
# changes go.mod/go.sum the PR left them out of sync — fail and show
|
||||||
|
# the diff so the author can commit the tidied result.
|
||||||
|
run: |
|
||||||
|
go mod tidy
|
||||||
|
git diff --exit-code go.mod go.sum
|
||||||
|
|
||||||
- name: Ensure base ref is available for lint
|
- name: Ensure base ref is available for lint
|
||||||
# golangci-lint's new-from-merge-base needs origin/master present.
|
# golangci-lint's new-from-merge-base needs origin/master present.
|
||||||
run: git fetch --no-tags origin master
|
run: git fetch --no-tags origin master
|
||||||
|
|||||||
@ -18,9 +18,9 @@ If you have `logos-delivery` checked out, point the build to it:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# path to your existing logos-delivery clone
|
# path to your existing logos-delivery clone
|
||||||
export LMN_DIR=/absolute/path/to/logos-delivery
|
export LOGOS_DELIVERY_DIR=/absolute/path/to/logos-delivery
|
||||||
export CGO_CFLAGS="-I${LMN_DIR}/library"
|
export CGO_CFLAGS="-I${LOGOS_DELIVERY_DIR}/library"
|
||||||
export CGO_LDFLAGS="-L${LMN_DIR}/build -lwaku -Wl,-rpath,${LMN_DIR}/build"
|
export CGO_LDFLAGS="-L${LOGOS_DELIVERY_DIR}/build -lwaku -Wl,-rpath,${LOGOS_DELIVERY_DIR}/build"
|
||||||
|
|
||||||
# compile all packages
|
# compile all packages
|
||||||
make -C waku build
|
make -C waku build
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
# Makefile for Waku Go Bindings
|
# Makefile for Waku Go Bindings
|
||||||
|
|
||||||
# Path to logos-delivery submodule
|
# Path to logos-delivery submodule
|
||||||
export LMN_DIR ?= $(shell pwd)/../vendor/logos-delivery
|
export LOGOS_DELIVERY_DIR ?= $(shell pwd)/../vendor/logos-delivery
|
||||||
|
|
||||||
# Debugging output
|
# Debugging output
|
||||||
print-paths:
|
print-paths:
|
||||||
@echo "LMN_DIR: $(LMN_DIR)"
|
@echo "LOGOS_DELIVERY_DIR: $(LOGOS_DELIVERY_DIR)"
|
||||||
@echo "HEADER_PATH: $(LIBWAKU_HEADER_PATH)"
|
@echo "HEADER_PATH: $(LIBWAKU_HEADER_PATH)"
|
||||||
@echo "LIB_PATH: $(LIBWAKU_LIB_PATH)"
|
@echo "LIB_PATH: $(LIBWAKU_LIB_PATH)"
|
||||||
|
|
||||||
# Default paths for libwaku library and headers (can be overridden)
|
# Default paths for libwaku library and headers (can be overridden)
|
||||||
export LIBWAKU_HEADER_PATH ?= $(LMN_DIR)/library
|
export LIBWAKU_HEADER_PATH ?= $(LOGOS_DELIVERY_DIR)/library
|
||||||
export LIBWAKU_LIB_PATH ?= $(LMN_DIR)/build
|
export LIBWAKU_LIB_PATH ?= $(LOGOS_DELIVERY_DIR)/build
|
||||||
|
|
||||||
export CGO_CFLAGS := -I$(LIBWAKU_HEADER_PATH)/
|
export CGO_CFLAGS := -I$(LIBWAKU_HEADER_PATH)/
|
||||||
export CGO_LDFLAGS := -L$(LIBWAKU_LIB_PATH)/ -lwaku -Wl,-rpath,$(LIBWAKU_LIB_PATH)/
|
export CGO_LDFLAGS := -L$(LIBWAKU_LIB_PATH)/ -lwaku -Wl,-rpath,$(LIBWAKU_LIB_PATH)/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user