Track upstream master for the MEOS derivation #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/ |