Skip to content

feat: e2e dataset benchmarks, CI gate, contributor docs (#21) (#22) #68

feat: e2e dataset benchmarks, CI gate, contributor docs (#21) (#22)

feat: e2e dataset benchmarks, CI gate, contributor docs (#21) (#22) #68

Workflow file for this run

name: CI & Release
on:
push:
branches: [main, beta]
pull_request:
branches: [main, beta]
# EGITNOPERMISSION: set Actions workflow permissions to Read/Write, or add SEMANTIC_RELEASE_GH_TOKEN (PAT with repo + branch bypass).
permissions:
contents: write
issues: write
pull-requests: write
checks: write
id-token: write
# Skip Husky hook installation in CI (hooks are for local commits only).
env:
HUSKY: 0
jobs:
# Separate jobs so each name appears as a GitHub status check (branch protection).
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run lint
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run format:check
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run test:coverage
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage/lcov.info
- run: npm run build
benchmark-e2e-dataset:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: queryd_bench
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d queryd_bench"
--health-interval 2s
--health-timeout 5s
--health-retries 30
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/queryd_bench
BENCH_DATASET_ROWS: 80000
BENCH_ITERATIONS: 600
BENCH_WARMUP: 60
BENCH_SERIES_RUNS: 3
BENCH_OUTPUT_FILE: bench/latest-e2e-dataset.json
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- name: Run dataset benchmark + regression compare
run: |
mkdir -p bench
npm run benchmark:e2e:dataset
npm run bench:compare:e2e:dataset
release-readiness:
needs: [lint, format, test, benchmark-e2e-dataset]
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
permissions:
# semantic-release dry-run runs `git push --dry-run` and needs write to pass.
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run build
- name: Release dry-run
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEMANTIC_RELEASE_GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
# Env name must be NPM_TOKEN for @semantic-release/npm; value from repo secret NPM_SECRET.
NPM_TOKEN: ${{ secrets.NPM_SECRET }}
run: |
if [ -n "${SEMANTIC_RELEASE_GH_TOKEN}" ]; then
export GH_TOKEN="${SEMANTIC_RELEASE_GH_TOKEN}"
fi
npm run release:dry-run
# Until Trusted Publisher: npm token secret + always-auth + registry-url (see gist). Then OIDC-only.
release:
needs: [lint, format, test, release-readiness]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
always-auth: true
registry-url: https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }}
- run: npm ci
- run: npm run build
- name: Semantic release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }}
NPM_TOKEN: ${{ secrets.NPM_SECRET }}
SEMANTIC_RELEASE_GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
run: |
if [ -n "${SEMANTIC_RELEASE_GH_TOKEN}" ]; then
export GH_TOKEN="${SEMANTIC_RELEASE_GH_TOKEN}"
fi
npm run semantic-release