Skip to content

docs: full documentation suite + npm publish workflow #1

docs: full documentation suite + npm publish workflow

docs: full documentation suite + npm publish workflow #1

Workflow file for this run

name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# CI-safe: core + memory, no external services
test:
name: Unit tests (core + memory)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm test
# Integration: MongoDB + DynamoDB
test-integration-document:
name: Integration tests (MongoDB + DynamoDB)
runs-on: ubuntu-latest
needs: test
services:
mongodb:
image: mongo:7
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })' --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
dynamodb-local:
image: amazon/dynamodb-local:latest
ports:
- 8000:8000
options: >-
--health-cmd "curl -f http://localhost:8000/shell/ || exit 1"
--health-interval 5s
--health-timeout 3s
--health-retries 10
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run integration tests (MongoDB)
env:
MONGODB_URL: jsnoslqc:mongodb://localhost:27017/jsnoslqc_ci
run: npm test --workspace=packages/mongodb
- name: Run integration tests (DynamoDB)
env:
DYNAMODB_ENDPOINT: http://localhost:8000
DYNAMODB_REGION: us-east-1
AWS_ACCESS_KEY_ID: local
AWS_SECRET_ACCESS_KEY: local
run: npm test --workspace=packages/dynamodb
# Integration: Firestore + Cosmos DB
test-integration-cloud:
name: Integration tests (Firestore + Cosmos DB)
runs-on: ubuntu-latest
needs: test
services:
firestore-emulator:
image: mtlynch/firestore-emulator
ports:
- 8080:8080
env:
FIRESTORE_PROJECT_ID: jsnoslqc-ci
PORT: 8080
cosmosdb-emulator:
image: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
ports:
- 8081:8081
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Wait for Firestore emulator
run: |
for i in $(seq 1 20); do
curl -sf http://localhost:8080/ && break
sleep 3
done
- name: Run integration tests (Firestore)
env:
FIRESTORE_EMULATOR_HOST: localhost:8080
FIRESTORE_PROJECT_ID: jsnoslqc-ci
run: npm test --workspace=packages/firestore
- name: Wait for Cosmos DB emulator
run: |
for i in $(seq 1 30); do
curl -sf http://localhost:8081/ && break
sleep 5
done
- name: Run integration tests (Cosmos DB)
run: npm test --workspace=packages/cosmosdb
# Integration: Redis + Cassandra
test-integration-kvstore:
name: Integration tests (Redis + Cassandra)
runs-on: ubuntu-latest
needs: test
services:
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
cassandra:
image: cassandra:4
ports:
- 9042:9042
options: >-
--health-cmd "cqlsh -e 'describe keyspaces'"
--health-interval 15s
--health-timeout 10s
--health-retries 10
--health-start-period 60s
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: npm
- name: Install dependencies
run: npm ci
- name: Run integration tests (Redis)
run: npm test --workspace=packages/redis
- name: Run integration tests (Cassandra)
run: npm test --workspace=packages/cassandra