Skip to content

Merge pull request #7 from GreptimeTeam/ci/bun-deno #25

Merge pull request #7 from GreptimeTeam/ci/bun-deno

Merge pull request #7 from GreptimeTeam/ci/bun-deno #25

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
verify:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.15.9
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm codegen:check
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm format:check
- run: pnpm test
- run: pnpm build
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.15.9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# GitHub `services:` cannot override the image's CMD, but the upstream
# `greptime/greptimedb` image ships an entrypoint that prints help and
# exits unless a subcommand (`standalone start ...`) is passed. Run the
# container manually so we can supply the right command.
# Server version is pinned. Bumping it is intentional: review the bump in PR
# so any server-behavior change shows up as a deliberate diff, not a flaky CI.
- name: Start GreptimeDB
env:
GREPTIMEDB_VERSION: v1.0.0
run: |
docker run -d --name greptimedb \
-p 4000:4000 -p 4001:4001 -p 4002:4002 \
"greptime/greptimedb:${GREPTIMEDB_VERSION}" standalone start \
--http-addr 0.0.0.0:4000 \
--rpc-bind-addr 0.0.0.0:4001 \
--mysql-addr 0.0.0.0:4002
- name: Wait for GreptimeDB readiness
run: |
for i in $(seq 1 60); do
if curl -fsS http://127.0.0.1:4000/health >/dev/null 2>&1; then
echo "GreptimeDB is ready"
exit 0
fi
sleep 1
done
echo "GreptimeDB failed to become ready"
docker logs greptimedb
exit 1
- run: INTEGRATION=1 pnpm test:integration
env:
GREPTIMEDB_ENDPOINT: localhost:4001
GREPTIMEDB_HTTP: http://127.0.0.1:4000
- name: Dump GreptimeDB logs on failure
if: failure()
run: docker logs greptimedb
- name: Stop GreptimeDB
if: always()
run: docker rm -f greptimedb || true
bun-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.15.9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: pnpm install --frozen-lockfile
- name: Start GreptimeDB
env:
GREPTIMEDB_VERSION: v1.0.0
run: |
docker run -d --name greptimedb-bun \
-p 4000:4000 -p 4001:4001 -p 4002:4002 \
"greptime/greptimedb:${GREPTIMEDB_VERSION}" standalone start \
--http-addr 0.0.0.0:4000 \
--rpc-bind-addr 0.0.0.0:4001 \
--mysql-addr 0.0.0.0:4002
- name: Wait for GreptimeDB readiness
run: |
for i in $(seq 1 60); do
if curl -fsS http://127.0.0.1:4000/health >/dev/null 2>&1; then
echo "GreptimeDB is ready"
exit 0
fi
sleep 1
done
echo "GreptimeDB failed to become ready"
docker logs greptimedb-bun
exit 1
- run: bun run scripts/smoke.ts
env:
GREPTIMEDB_ENDPOINT: localhost:4001
GREPTIMEDB_HTTP: http://127.0.0.1:4000
- name: Dump GreptimeDB logs on failure
if: failure()
run: docker logs greptimedb-bun
- name: Stop GreptimeDB
if: always()
run: docker rm -f greptimedb-bun || true
deno-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.15.9
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- uses: denoland/setup-deno@v2
with:
deno-version: v2.x
- run: pnpm install --frozen-lockfile
- name: Start GreptimeDB
env:
GREPTIMEDB_VERSION: v1.0.0
run: |
docker run -d --name greptimedb-deno \
-p 4000:4000 -p 4001:4001 -p 4002:4002 \
"greptime/greptimedb:${GREPTIMEDB_VERSION}" standalone start \
--http-addr 0.0.0.0:4000 \
--rpc-bind-addr 0.0.0.0:4001 \
--mysql-addr 0.0.0.0:4002
- name: Wait for GreptimeDB readiness
run: |
for i in $(seq 1 60); do
if curl -fsS http://127.0.0.1:4000/health >/dev/null 2>&1; then
echo "GreptimeDB is ready"
exit 0
fi
sleep 1
done
echo "GreptimeDB failed to become ready"
docker logs greptimedb-deno
exit 1
- run: deno run -A scripts/smoke.ts
env:
GREPTIMEDB_ENDPOINT: localhost:4001
GREPTIMEDB_HTTP: http://127.0.0.1:4000
- name: Dump GreptimeDB logs on failure
if: failure()
run: docker logs greptimedb-deno
- name: Stop GreptimeDB
if: always()
run: docker rm -f greptimedb-deno || true