forked from MobilityDB/GoMEOS
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 3.08 KB
/
Copy pathbuild.yml
File metadata and controls
80 lines (68 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: build
# Derive the MEOS catalog and the all-families libmeos from a single
# MobilityDB commit via the shared provision-meos action (the same derivation
# JMEOS / Spark / PyMEOS-CFFI consume), regenerate the flat FFI functions
# package from that catalog, and prove the committed generated code is in sync
# with it. No MEOS header is parsed in this repository: the functions package
# is a projection of the catalog, and cgo only compiles it against the
# installed libmeos. The catalog itself is never committed — it is derived
# here from MobilityDB.
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Provision catalog + build GoMEOS (Linux, all families)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Provision MEOS (catalog + all-families libmeos)
id: provision
# Derive the MEOS catalog (meos-idl.json) and the libmeos build from upstream
# MobilityDB master through the shared provision-meos action. Tracking master
# (not a pinned commit) keeps the source, the catalog and the native library the
# binding is generated against all moving together.
uses: MobilityDB/MEOS-API/.github/actions/provision-meos@master
with:
mobilitydb-ref: master
build-libmeos: "true"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23"
- name: Stage the derived catalog for the generator
run: cp "${{ steps.provision.outputs.catalog-path }}" tools/meos-idl.json
- name: Regenerate the functions package from the catalog
run: python3 tools/codegen.py
- name: Report drift between the committed and freshly derived functions package
run: |
# Informational only: CI builds and tests the FRESHLY regenerated
# functions/ above, so a drift against the committed snapshot never
# fails the build (MobilityDB master moves independently of this repo).
# The committed functions/ is a convenience snapshot for `go get`
# consumers; refresh it by running 'python3 tools/codegen.py' against a
# freshly derived meos-idl.json and committing the result.
if ! git diff --quiet -- functions/; then
echo "::notice::functions/ differs from the freshly derived catalog (snapshot lags MobilityDB master):"
git diff --stat -- functions/
else
echo "functions/ snapshot is in sync with the derived catalog."
fi
- name: Build the generated functions package against the all-families libmeos
env:
CGO_CFLAGS: -I/usr/local/include -I/usr/include/h3
CGO_LDFLAGS: -L/usr/local/lib -lmeos
LD_LIBRARY_PATH: /usr/local/lib
run: go build ./functions
- name: Run the portable-parity gate
env:
CGO_ENABLED: "0"
run: go test ./tools/parity/