Skip to content

fix: add forward declare for execute-full (query.clj) #9

fix: add forward declare for execute-full (query.clj)

fix: add forward declare for execute-full (query.clj) #9

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: ['v*']
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build & verify
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '11'
# No `cache: maven` here: this is a deps.edn project with no pom.xml,
# so the Maven cache lookup fails the job. Deps are cached by the
# actions/cache step below instead.
- name: Install Clojure CLI
# Install the official Clojure CLI directly via download.clojure.org
# (DeLaGuardo/setup-clojure intermittently 403s on GitHub asset
# downloads, issue #42). The linux-install script is the canonical
# install method for deps.edn projects. Pin to 1.11.1.1403 (the last
# 1.11.x CLI) because the code targets Clojure 1.11 and the 1.12 CLI
# bundles a stricter compiler that rejects the inner-class type hints.
run: |
curl -fsSL https://github.com/clojure/brew-install/releases/download/1.11.1.1403/linux-install.sh -o /tmp/linux-install.sh
chmod +x /tmp/linux-install.sh
/tmp/linux-install.sh --prefix "$HOME/.local" --version 1.11.1.1403
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
shell: bash
- name: Cache Clojure deps
uses: actions/cache@v6
with:
path: |
~/.m2
~/.gitlibs
~/.clojure
.cpcache
key: clj-deps-${{ runner.os }}-${{ hashFiles('deps.edn') }}
restore-keys: |
clj-deps-${{ runner.os }}-
- name: Print versions
run: |
clojure --version
java -version
- name: Compile Java exception classes
# Compile the five tiny Java exception classes AOT so the Clojure code
# can catch them by type. Output goes to target/classes (on the path).
run: |
mkdir -p target/classes
javac -d target/classes $(find java-src -name '*.java')
- name: Offline tests (no daemon)
# Run the test suite without a daemon; the live tests self-skip and the
# offline in-process tests run normally.
run: clojure -M:test -m visorcraft.mongreldb.live-test --offline
live:
# Boots a real mongreldb-server and runs the live round-trip suite.
name: Live integration (against mongreldb-server)
runs-on: ubuntu-latest
env:
SERVER_VERSION: '0.46.2'
MONGRELDB_URL: http://127.0.0.1:8453
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '11'
# No `cache: maven` here: this is a deps.edn project with no pom.xml,
# so the Maven cache lookup fails the job. Deps are cached by the
# actions/cache step below instead.
- name: Install Clojure CLI
run: |
curl -fsSL https://github.com/clojure/brew-install/releases/download/1.11.1.1403/linux-install.sh -o /tmp/linux-install.sh
chmod +x /tmp/linux-install.sh
/tmp/linux-install.sh --prefix "$HOME/.local" --version 1.11.1.1403
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
shell: bash
- name: Cache Clojure deps
uses: actions/cache@v6
with:
path: |
~/.m2
~/.gitlibs
~/.clojure
.cpcache
key: clj-deps-${{ runner.os }}-${{ hashFiles('deps.edn') }}
restore-keys: |
clj-deps-${{ runner.os }}-
- name: Print versions
run: |
clojure --version
java -version
- name: Compile Java exception classes
run: |
mkdir -p target/classes
javac -d target/classes $(find java-src -name '*.java')
- name: Cache mongreldb-server binary
id: server-cache
uses: actions/cache@v6
with:
path: bin/mongreldb-server
key: mongreldb-server-linux-x64-${{ env.SERVER_VERSION }}
- name: Download mongreldb-server
if: steps.server-cache.outputs.cache-hit != 'true'
run: |
mkdir -p bin
curl -fsSL -o bin/mongreldb-server \
"https://github.com/visorcraft/MongrelDB/releases/download/v${SERVER_VERSION}/mongreldb-server-linux-x64"
chmod +x bin/mongreldb-server
./bin/mongreldb-server --help | head -n 1
- name: Start mongreldb-server
run: |
rm -rf /tmp/mongreldb-data
./bin/mongreldb-server /tmp/mongreldb-data --port 8453 > /tmp/mongreldb-server.log 2>&1 &
echo $! > /tmp/mongreldb-server.pid
# Wait for the daemon to become healthy (max ~30s).
for i in $(seq 1 30); do
if curl -sf http://127.0.0.1:8453/health >/dev/null 2>&1; then
echo "mongreldb-server is healthy"
break
fi
sleep 1
done
curl -sf http://127.0.0.1:8453/health >/dev/null || (cat /tmp/mongreldb-server.log && exit 1)
- name: Run live tests
run: clojure -M:test -m visorcraft.mongreldb.live-test
- name: Run examples
run: |
for ex in basic-crud query-builder-example transactions-example; do
echo "=== Running $ex ==="
clojure -M:examples -m "$ex" || { echo "FAILED: $ex"; exit 1; }
done
- name: Dump server log on failure
if: failure()
run: cat /tmp/mongreldb-server.log
- name: Stop mongreldb-server
if: always()
run: |
if [ -f /tmp/mongreldb-server.pid ]; then
kill "$(cat /tmp/mongreldb-server.pid)" 2>/dev/null || true
fi