ae2c34df6c
Introduce a one‑line Docker installer and environment examples, add CI and docker validation workflows, and update docs and tests. Key changes: - Add docker/install.sh installer that bootstraps /opt/synapsis, downloads compose files, optionally installs Docker, and generates secrets. - Add top-level .env.example and docker/.env.example entries for shared storage and local development. - Add GitHub Actions CI (ci.yml) with type checks, targeted vitest runs, build and docker-compose validation. - Update existing docker workflow to set up QEMU and build multi‑arch images (amd64, arm64). - Update README and docker/README to use the installer, point to the new repo, adjust local setup instructions, and note shared S3 env vars. - Update docker-compose comments and include shared S3 env variables and defaults. - Update .gitignore to ignore site-work mirrors. - Tests: expand supported bot source types (add brave_news, youtube), increase POST_MAX_LENGTH from 400 to 600, add minimal user handle in mention handler tests, and add mocks & test adjustments in scheduler tests to keep them unit-scoped. These changes simplify installation, add CI coverage (including Docker config validation), enable multi‑arch builds, and align tests with expanded bot source/validation behavior.
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
smoke:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Type check
|
|
run: npm run type-check
|
|
|
|
- name: Targeted bot regression checks
|
|
run: >
|
|
AUTH_SECRET=ci-test-secret
|
|
npx vitest run
|
|
src/lib/bots/encryption.test.ts
|
|
src/lib/bots/contentSource.test.ts
|
|
src/lib/bots/posting.property.test.ts
|
|
src/lib/bots/mentionHandler.property.test.ts
|
|
src/lib/bots/scheduler.test.ts
|
|
|
|
- name: Production build
|
|
run: npm run build
|
|
|
|
docker-validation:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Validate production compose config
|
|
run: docker compose --env-file docker/.env.example config > /tmp/synapsis-compose.txt
|
|
|
|
- name: Validate source-build compose config
|
|
run: docker compose -f docker/docker-compose.yml --env-file docker/.env.example config > /tmp/synapsis-build-compose.txt
|
|
|
|
- name: Build application image
|
|
run: docker build -f docker/Dockerfile .
|