From cab85096082c06144739f1e3b4a95d778ca4e4de Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Mon, 4 May 2026 08:55:34 -0500 Subject: [PATCH] add gitflow CI for dev/stage/prod environments --- ql/.gitea/workflows/ci-dev.yaml | 89 +++++++++++++++++++++++++++++++ ql/.gitea/workflows/ci-stage.yaml | 87 ++++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 ql/.gitea/workflows/ci-dev.yaml create mode 100644 ql/.gitea/workflows/ci-stage.yaml diff --git a/ql/.gitea/workflows/ci-dev.yaml b/ql/.gitea/workflows/ci-dev.yaml new file mode 100644 index 0000000..76d9bef --- /dev/null +++ b/ql/.gitea/workflows/ci-dev.yaml @@ -0,0 +1,89 @@ +name: ElQL CI — dev + +on: + push: + branches: + - dev + pull_request: + branches: + - dev + +# ElQL is a set of standalone El programs run against a live Engram server. +# It has no compiled artifact to publish. CI verifies that all .el files +# parse and compile (emit valid C) using elc. + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + apt-get update -qq + apt-get install -y gcc libcurl4-openssl-dev + + - name: Install El SDK from dev registry + env: + GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} + run: | + echo "${GCP_SA_KEY}" > /tmp/gcp-key.json + apt-get install -y -qq apt-transport-https ca-certificates gnupg curl + curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list + apt-get update -qq && apt-get install -y google-cloud-cli + gcloud auth activate-service-account --key-file=/tmp/gcp-key.json + gcloud config set project neuron-785695 + + mkdir -p /usr/local/bin /usr/local/lib/el + + LATEST_VERSION=$(gcloud artifacts versions list \ + --repository=foundation-dev \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el/elc \ + --format="value(name)" 2>/dev/null | sort | tail -1 | sed 's|.*/||' || true) + + if [ -n "${LATEST_VERSION}" ]; then + gcloud artifacts generic download \ + --repository=foundation-dev \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el/elc \ + --version="${LATEST_VERSION}" \ + --destination=/usr/local/bin/elc + chmod +x /usr/local/bin/elc + else + echo "Falling back to Gitea latest release..." + curl -fsSL "https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest/elc" \ + -o /usr/local/bin/elc + chmod +x /usr/local/bin/elc + fi + + RELEASE_BASE="https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest" + curl -fsSL "${RELEASE_BASE}/el_runtime.c" -o /usr/local/lib/el/el_runtime.c + curl -fsSL "${RELEASE_BASE}/el_runtime.h" -o /usr/local/lib/el/el_runtime.h + + echo "El SDK installed:"; elc --version || true + rm -f /tmp/gcp-key.json + + # Compile-check all standalone .el programs (studio, field tests, language tests, llm tests) + - name: Compile-check all El programs + run: | + PASS=0; FAIL=0 + for f in studio/studio.el test/field_test.el test/language_features_test.el test/llm_test.el studio.el; do + [ -f "$f" ] || continue + echo -n "Compiling $f ... " + if elc "$f" > /dev/null 2>&1; then + echo "OK" + PASS=$((PASS+1)) + else + echo "FAIL" + elc "$f" 2>&1 | head -10 + FAIL=$((FAIL+1)) + fi + done + echo "Passed: ${PASS}, Failed: ${FAIL}" + [ "${FAIL}" -eq 0 ] diff --git a/ql/.gitea/workflows/ci-stage.yaml b/ql/.gitea/workflows/ci-stage.yaml new file mode 100644 index 0000000..734a59a --- /dev/null +++ b/ql/.gitea/workflows/ci-stage.yaml @@ -0,0 +1,87 @@ +name: ElQL CI — stage + +on: + push: + branches: + - stage + pull_request: + branches: + - stage + +# ElQL is a set of standalone El programs run against a live Engram server. +# CI verifies all .el files compile cleanly using the stage-level El SDK. + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install build dependencies + run: | + apt-get update -qq + apt-get install -y gcc libcurl4-openssl-dev + + - name: Install El SDK from stage registry + env: + GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} + run: | + echo "${GCP_SA_KEY}" > /tmp/gcp-key.json + apt-get install -y -qq apt-transport-https ca-certificates gnupg curl + curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg + echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list + apt-get update -qq && apt-get install -y google-cloud-cli + gcloud auth activate-service-account --key-file=/tmp/gcp-key.json + gcloud config set project neuron-785695 + + mkdir -p /usr/local/bin /usr/local/lib/el + + LATEST_VERSION=$(gcloud artifacts versions list \ + --repository=foundation-stage \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el/elc \ + --format="value(name)" 2>/dev/null | sort | tail -1 | sed 's|.*/||' || true) + + if [ -n "${LATEST_VERSION}" ]; then + gcloud artifacts generic download \ + --repository=foundation-stage \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el/elc \ + --version="${LATEST_VERSION}" \ + --destination=/usr/local/bin/elc + chmod +x /usr/local/bin/elc + else + echo "Falling back to Gitea latest release..." + curl -fsSL "https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest/elc" \ + -o /usr/local/bin/elc + chmod +x /usr/local/bin/elc + fi + + RELEASE_BASE="https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest" + curl -fsSL "${RELEASE_BASE}/el_runtime.c" -o /usr/local/lib/el/el_runtime.c + curl -fsSL "${RELEASE_BASE}/el_runtime.h" -o /usr/local/lib/el/el_runtime.h + + echo "El SDK installed:"; elc --version || true + rm -f /tmp/gcp-key.json + + - name: Compile-check all El programs + run: | + PASS=0; FAIL=0 + for f in studio/studio.el test/field_test.el test/language_features_test.el test/llm_test.el studio.el; do + [ -f "$f" ] || continue + echo -n "Compiling $f ... " + if elc "$f" > /dev/null 2>&1; then + echo "OK" + PASS=$((PASS+1)) + else + echo "FAIL" + elc "$f" 2>&1 | head -10 + FAIL=$((FAIL+1)) + fi + done + echo "Passed: ${PASS}, Failed: ${FAIL}" + [ "${FAIL}" -eq 0 ]