RFC 0035: a Python-free type layer #973
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: Native C++ validation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| env: | |
| GCC_VERSION: "14" | |
| SCCACHE_GHA_ENABLED: "true" | |
| jobs: | |
| native-cpp: | |
| name: Native C++ / ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| parallel: "4" | |
| - os: macos-26 | |
| parallel: "2" | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Enable shared compiler cache | |
| uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 | |
| with: | |
| version: v0.15.0 | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Configure current Clang on macOS | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| echo "CC=/usr/bin/clang" >> "$GITHUB_ENV" | |
| echo "CXX=/usr/bin/clang++" >> "$GITHUB_ENV" | |
| /usr/bin/clang++ --version | |
| - name: Configure GCC 14 on Linux | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| cc_path="$(command -v "gcc-$GCC_VERSION")" | |
| cxx_path="$(command -v "g++-$GCC_VERSION")" | |
| test "$("$cxx_path" -dumpfullversion -dumpversion | cut -d. -f1)" -eq "$GCC_VERSION" | |
| echo "CC=$cc_path" >> "$GITHUB_ENV" | |
| echo "CXX=$cxx_path" >> "$GITHUB_ENV" | |
| "$cxx_path" --version | |
| - name: Install native build dependencies | |
| run: >- | |
| python -m pip install --upgrade --only-binary=:all: | |
| "cmake==4.4.2" "ninja==1.13.0" "pyarrow==25.0.0" | |
| - name: Expose Arrow runtime libraries | |
| shell: python | |
| run: | | |
| import os | |
| from pathlib import Path | |
| import pyarrow | |
| with open(os.environ["GITHUB_PATH"], "a", encoding="utf-8") as path_file: | |
| path_file.write(str(Path(pyarrow.__file__).resolve().parent) + "\n") | |
| - name: Configure native C++ tests | |
| run: cmake -S . -B build-native -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DHGRAPH_BUILD_PYTHON_BINDINGS=OFF -DHGRAPH_ENABLE_PYTHON_USER_NODES=OFF -DHGRAPH_ENABLE_IDE_PYTHON_HEADER_HINTS=OFF -DHGRAPH_USE_PYARROW_ARROW=ON -DHGRAPH_FETCH_SIMDJSON=ON -DHGRAPH_FETCH_DATE=ON -DHGRAPH_ENABLE_DEBUGGER_SMOKE_TESTS=ON -DHGRAPH_WARNINGS_AS_ERRORS=ON -DHGRAPH_BUILD_KAFKA_EXTENSION=ON -DHGRAPH_KAFKA_FORCE_FETCH_LIBRDKAFKA=ON -DHGRAPH_BUILD_ANALYTICS_EXTENSION=ON -DHGRAPH_BUILD_WEB_EXTENSION=ON | |
| -DHGRAPH_BUILD_PERSISTENCE_EXTENSION=ON | |
| -DHGRAPH_BUILD_FABRIC_EXTENSION=ON | |
| - name: Build native C++ tests | |
| run: cmake --build build-native --parallel ${{ matrix.parallel }} | |
| - name: Run native C++ tests | |
| run: ctest --test-dir build-native --output-on-failure --parallel ${{ matrix.parallel }} | |
| - name: Run restartable Kafka broker conformance | |
| if: runner.os == 'Linux' | |
| run: >- | |
| python3 extensions/fabric/tools/run_kafka_broker_conformance.py | |
| --test-executable | |
| build-native/extensions/fabric/tests/hgraph_fabric_kafka_tests | |
| - name: HTTP/2 conformance (h2spec) | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| curl -fsSL --proto '=https' --tlsv1.2 -o /tmp/h2spec.tar.gz \ | |
| https://github.com/summerwind/h2spec/releases/download/v2.6.0/h2spec_linux_amd64.tar.gz | |
| tar -xzf /tmp/h2spec.tar.gz -C /tmp | |
| python3 extensions/web/tools/run_h2spec.py \ | |
| build-native/extensions/web/tests/hgraph_web_h2spec_server /tmp/h2spec | |
| - name: Start the S3 conformance endpoint | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| docker run --detach --name hgraph-minio -p 9010:9000 \ | |
| -e MINIO_ROOT_USER=hgraphtest \ | |
| -e MINIO_ROOT_PASSWORD=hgraphtest123 \ | |
| quay.io/minio/minio@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e \ | |
| server /data | |
| for attempt in {1..30}; do | |
| if curl --fail --silent http://127.0.0.1:9010/minio/health/live >/dev/null; then | |
| break | |
| fi | |
| sleep 1 | |
| done | |
| curl --fail --silent http://127.0.0.1:9010/minio/health/live >/dev/null | |
| docker run --rm --network container:hgraph-minio --entrypoint /bin/sh \ | |
| quay.io/minio/mc@sha256:a7fe349ef4bd8521fb8497f55c6042871b2ae640607cf99d9bede5e9bdf11727 \ | |
| -c '/usr/bin/mc alias set local http://127.0.0.1:9000 hgraphtest hgraphtest123 && /usr/bin/mc mb --ignore-existing local/hgraph-test' | |
| - name: Run S3 persistence and Fabric conformance | |
| if: runner.os == 'Linux' | |
| env: | |
| HGRAPH_S3_TEST_ENDPOINT: http://127.0.0.1:9010 | |
| HGRAPH_S3_TEST_BUCKET: hgraph-test | |
| AWS_ACCESS_KEY_ID: hgraphtest | |
| AWS_SECRET_ACCESS_KEY: hgraphtest123 | |
| run: | | |
| ./build-native/extensions/persistence/tests/hgraph_persistence_tests "[s3]" | |
| ./build-native/extensions/fabric/tests/hgraph_fabric_tests "[s3]" | |
| - name: Stop the S3 conformance endpoint | |
| if: runner.os == 'Linux' && always() | |
| run: docker rm --force hgraph-minio || true | |
| native-cpp-core-only: | |
| # Every other native leg forces the extensions ON, so nothing verified that | |
| # core still stands on its own. RFC 0025 makes that a release criterion: | |
| # core owns no durable-store policy, so a core-only consumer must build, | |
| # pass, and resolve no Parquet. | |
| name: Native C++ / Linux core-only (no extensions) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Enable shared compiler cache | |
| uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 | |
| with: | |
| version: v0.15.0 | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Configure GCC 14 | |
| shell: bash | |
| run: | | |
| cc_path="$(command -v "gcc-$GCC_VERSION")" | |
| cxx_path="$(command -v "g++-$GCC_VERSION")" | |
| test "$("$cxx_path" -dumpfullversion -dumpversion | cut -d. -f1)" -eq "$GCC_VERSION" | |
| echo "CC=$cc_path" >> "$GITHUB_ENV" | |
| echo "CXX=$cxx_path" >> "$GITHUB_ENV" | |
| - name: Install native build dependencies | |
| run: >- | |
| python -m pip install --upgrade --only-binary=:all: | |
| "cmake==4.4.2" "ninja==1.13.0" "pyarrow==25.0.0" | |
| - name: Expose Arrow runtime libraries | |
| shell: python | |
| run: | | |
| import os | |
| from pathlib import Path | |
| import pyarrow | |
| with open(os.environ["GITHUB_PATH"], "a", encoding="utf-8") as path_file: | |
| path_file.write(str(Path(pyarrow.__file__).resolve().parent) + "\n") | |
| - name: Configure core-only C++ tests | |
| run: >- | |
| cmake -S . -B build-core-only -GNinja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DBUILD_TESTING=ON | |
| -DHGRAPH_BUILD_PYTHON_BINDINGS=OFF | |
| -DHGRAPH_ENABLE_PYTHON_USER_NODES=OFF | |
| -DHGRAPH_ENABLE_IDE_PYTHON_HEADER_HINTS=OFF | |
| -DHGRAPH_USE_PYARROW_ARROW=ON | |
| -DHGRAPH_FETCH_SIMDJSON=ON | |
| -DHGRAPH_FETCH_DATE=ON | |
| -DHGRAPH_WARNINGS_AS_ERRORS=ON | |
| -DHGRAPH_BUILD_KAFKA_EXTENSION=OFF | |
| -DHGRAPH_BUILD_ANALYTICS_EXTENSION=OFF | |
| -DHGRAPH_BUILD_WEB_EXTENSION=OFF | |
| -DHGRAPH_BUILD_PERSISTENCE_EXTENSION=OFF | |
| -DHGRAPH_BUILD_FABRIC_EXTENSION=OFF | |
| - name: Verify core resolves no durable-store dependency | |
| shell: bash | |
| run: | | |
| # Parquet and S3 are hgraph-persistence policy. A core-only configure | |
| # that resolves either has taken the dependency back (RFC 0025). | |
| if grep -Ei 'parquet' build-core-only/CMakeCache.txt; then | |
| echo "::error::core-only configure resolved Parquet; durable-store policy belongs to hgraph-persistence" | |
| exit 1 | |
| fi | |
| test ! -d build-core-only/extensions/persistence | |
| - name: Build core-only C++ tests | |
| run: cmake --build build-core-only --parallel 2 | |
| - name: Run core-only C++ tests | |
| run: ctest --test-dir build-core-only --output-on-failure --parallel 2 | |
| native-shared-install: | |
| name: Native C++ / Linux shared install with IPO | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Enable shared compiler cache | |
| uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10 | |
| with: | |
| version: v0.15.0 | |
| - name: Configure GCC 14 | |
| shell: bash | |
| run: | | |
| cc_path="$(command -v "gcc-$GCC_VERSION")" | |
| cxx_path="$(command -v "g++-$GCC_VERSION")" | |
| test "$("$cxx_path" -dumpfullversion -dumpversion | cut -d. -f1)" -eq "$GCC_VERSION" | |
| echo "CC=$cc_path" >> "$GITHUB_ENV" | |
| echo "CXX=$cxx_path" >> "$GITHUB_ENV" | |
| "$cxx_path" --version | |
| - uses: mamba-org/setup-micromamba@f457c30a868e4760d3a6fcea5f25dc655b8edf39 # v3 | |
| with: | |
| environment-name: hgraph-native | |
| cache-environment: true | |
| create-args: >- | |
| cmake>=3.26 | |
| ninja | |
| libarrow=25 | |
| libarrow-compute=25 | |
| libarrow-acero=25 | |
| fmt | |
| spdlog>=1.15 | |
| simdjson>=4.5 | |
| - name: Configure optimized shared C++ tests | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S . -B build-shared -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | |
| -DCMAKE_PREFIX_PATH="$CONDA_PREFIX" | |
| -DBUILD_TESTING=ON | |
| -DHGRAPH_BUILD_SHARED=ON | |
| -DHGRAPH_BUILD_PYTHON_BINDINGS=OFF | |
| -DHGRAPH_ENABLE_PYTHON_USER_NODES=OFF | |
| -DHGRAPH_ENABLE_IDE_PYTHON_HEADER_HINTS=OFF | |
| -DHGRAPH_FETCH_DATE=ON | |
| -DHGRAPH_ENABLE_DEBUGGER_SMOKE_TESTS=ON | |
| -DHGRAPH_WARNINGS_AS_ERRORS=ON | |
| -DHGRAPH_BUILD_KAFKA_EXTENSION=ON | |
| -DHGRAPH_KAFKA_FORCE_FETCH_LIBRDKAFKA=ON | |
| -DHGRAPH_BUILD_ANALYTICS_EXTENSION=ON | |
| -DHGRAPH_BUILD_WEB_EXTENSION=ON | |
| -DHGRAPH_BUILD_PERSISTENCE_EXTENSION=ON | |
| -DHGRAPH_BUILD_FABRIC_EXTENSION=ON | |
| - name: Verify IPO is enabled | |
| shell: micromamba-shell {0} | |
| run: >- | |
| grep -Eq -- '"command":.*-flto(=auto)?.*/src/hgraph/' | |
| build-shared/compile_commands.json | |
| - name: Build optimized shared C++ tests | |
| shell: micromamba-shell {0} | |
| run: cmake --build build-shared --parallel 2 | |
| - name: Run optimized shared C++ tests | |
| shell: micromamba-shell {0} | |
| run: ctest --test-dir build-shared --output-on-failure --parallel 2 | |
| - name: Install optimized shared C++ package | |
| shell: micromamba-shell {0} | |
| run: cmake --install build-shared --prefix "$GITHUB_WORKSPACE/install-shared" | |
| - name: Configure installed-package consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S tests/install_consumer -B build-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed-package consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-consumer --output-on-failure | |
| - name: Configure installed Kafka consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S extensions/kafka/test_package -B build-kafka-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed Kafka consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-kafka-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$GITHUB_WORKSPACE/install-shared/lib:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-kafka-consumer --output-on-failure | |
| - name: Configure installed analytics consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S extensions/analytics/test_package | |
| -B build-analytics-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed analytics consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-analytics-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$GITHUB_WORKSPACE/install-shared/lib:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-analytics-consumer --output-on-failure | |
| - name: Configure installed web consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S extensions/web/test_package -B build-web-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed web consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-web-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$GITHUB_WORKSPACE/install-shared/lib:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-web-consumer --output-on-failure | |
| - name: Configure installed persistence consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S extensions/persistence/test_package -B build-persistence-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed persistence consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-persistence-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$GITHUB_WORKSPACE/install-shared/lib:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-persistence-consumer --output-on-failure | |
| - name: Configure installed fabric consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S extensions/fabric/test_package -B build-fabric-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed fabric consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-fabric-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$GITHUB_WORKSPACE/install-shared/lib:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-fabric-consumer --output-on-failure | |
| - name: Configure installed fabric dependency consumer | |
| shell: micromamba-shell {0} | |
| run: >- | |
| cmake -S tests/fabric_dependency_consumer | |
| -B build-fabric-dependency-consumer -G Ninja | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DCMAKE_PREFIX_PATH="$GITHUB_WORKSPACE/install-shared;$CONDA_PREFIX" | |
| - name: Build and test installed fabric dependency consumer | |
| shell: micromamba-shell {0} | |
| run: | | |
| cmake --build build-fabric-dependency-consumer --parallel 2 | |
| LD_LIBRARY_PATH="$GITHUB_WORKSPACE/install-shared/lib:$CONDA_PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ | |
| ctest --test-dir build-fabric-dependency-consumer --output-on-failure |