|
| 1 | +name: Vendor drift (MEOS-API) |
| 2 | + |
| 3 | +# Re-runs the `make vendor-meos-api` target against the live MEOS-API master |
| 4 | +# and fails if the vendored artefacts under `vendor/meos-api/` are out of date. |
| 5 | +# |
| 6 | +# Surfaces upstream changes as actionable PR diffs instead of letting them |
| 7 | +# silently rot. The CI failure message tells the maintainer to run |
| 8 | +# |
| 9 | +# make vendor-meos-api |
| 10 | +# |
| 11 | +# locally and submit a refresh PR. |
| 12 | +# |
| 13 | +# Step 3 of `docs/MEOS_API_INGESTION_PLAN.md`. |
| 14 | + |
| 15 | +on: |
| 16 | + pull_request: |
| 17 | + paths: |
| 18 | + - 'vendor/meos-api/**' |
| 19 | + - 'Makefile' |
| 20 | + - '.github/workflows/vendor-drift.yml' |
| 21 | + push: |
| 22 | + branches: [master] |
| 23 | + schedule: |
| 24 | + # Daily 06:00 UTC — pings the maintainer if MEOS-API master moves and the |
| 25 | + # vendored copy goes stale, even without a MobilityAPI PR open. |
| 26 | + - cron: '0 6 * * *' |
| 27 | + workflow_dispatch: |
| 28 | + |
| 29 | +jobs: |
| 30 | + vendor-drift: |
| 31 | + name: Refresh & diff vendored artefacts |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + |
| 36 | + # libclang (the Python wheel) bundles the .so but not the system C |
| 37 | + # headers MEOS depends on (json-c, gsl, proj, postgres). Without them, |
| 38 | + # `size_t` degrades to `int`, `json_object *` degrades to `int *`, etc., |
| 39 | + # which would show up as false drift on every CI run. Install the same |
| 40 | + # dev headers a local MobilityDB build expects so libclang resolves |
| 41 | + # everything correctly. |
| 42 | + - name: Install dev headers for libclang sysroot (matches local parse) |
| 43 | + run: | |
| 44 | + sudo apt-get update -qq |
| 45 | + sudo apt-get install -y --no-install-recommends \ |
| 46 | + clang libclang-dev \ |
| 47 | + libjson-c-dev libgsl-dev libproj-dev libgeos-dev \ |
| 48 | + postgresql-server-dev-16 |
| 49 | +
|
| 50 | + - name: Refresh vendored MEOS-API artefacts from master |
| 51 | + run: make vendor-meos-api |
| 52 | + |
| 53 | + - name: Detect drift |
| 54 | + id: drift |
| 55 | + run: | |
| 56 | + if git diff --exit-code -- vendor/meos-api/; then |
| 57 | + echo "drift=false" >> "$GITHUB_OUTPUT" |
| 58 | + echo "::notice::vendor/meos-api/ is up to date with MEOS-API master." |
| 59 | + else |
| 60 | + echo "drift=true" >> "$GITHUB_OUTPUT" |
| 61 | + echo "::error::vendor/meos-api/ is stale. Run \`make vendor-meos-api\` locally and open a refresh PR." |
| 62 | + git diff --stat -- vendor/meos-api/ |
| 63 | + exit 1 |
| 64 | + fi |
0 commit comments