Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions .github/workflows/build-publish.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Build and Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22, 24, 26]

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

- name: Install dependencies
run: yarn

- name: Set Ribby as git user
run: |
git config user.name "Ribby"
git config user.email "bot@lftechnology.com"

- name: Check format
run: yarn format:check

- name: Lint code
run: yarn lint

- name: Build project
run: yarn build

- name: Test coverage
run: yarn test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
fail_ci_if_error: true
directory: ./coverage
files: ./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

examples:
name: Example ${{ matrix.example }} (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [22, 24, 26]
example:
- node-app-pg-ts
- node-app-mssql-ts
include:
- example: node-app-pg-ts
service: db
- example: node-app-mssql-ts
service: mssql

defaults:
run:
working-directory: examples/${{ matrix.example }}

steps:
- name: Checkout code
uses: actions/checkout@v7

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'

# Build and pack sync-db from this checkout so the example runs against
# the unreleased code instead of the version published on npm.
- name: Pack sync-db from source
working-directory: .
run: |
yarn --frozen-lockfile
yarn pack --filename "$RUNNER_TEMP/sync-db.tgz"

- name: Install example dependencies
run: |
yarn --frozen-lockfile
yarn add "$RUNNER_TEMP/sync-db.tgz" --no-lockfile

- name: Start database
run: docker compose up -d --wait ${{ matrix.service }}

- name: Configure connection
run: |
sed 's/"host": "${{ matrix.service }}"/"host": "localhost"/' connections.sync-db.json.example > connections.sync-db.json

- name: Synchronize (CLI)
run: yarn sync-db synchronize

- name: Synchronize (programmatic)
run: yarn synchronize:programmatic

- name: Run app
run: yarn start

- name: Stop database
if: always()
run: docker compose down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v7

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
13 changes: 11 additions & 2 deletions examples/node-app-mssql-ts/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@ version: '3.3'
services:
mssql:
container_name: 'example-mssql'
image: 'mcr.microsoft.com/mssql/server:2017-GA-ubuntu'
image: 'mcr.microsoft.com/mssql/server:2022-latest'
ports:
- '1433:1433'
environment:
ACCEPT_EULA: 'Y'
SA_PASSWORD: 'Secret@123'
MSSQL_SA_PASSWORD: 'Secret@123'
healthcheck:
test: ['CMD', 'bash', '-c', 'exec 3<>/dev/tcp/localhost/1433']
interval: 3s
timeout: 3s
retries: 40
start_period: 10s

app:
container_name: 'example-app'
environment:
DEBUG: 'sync-db*'
build: .
depends_on:
mssql:
condition: service_healthy
2 changes: 1 addition & 1 deletion examples/node-app-mssql-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@leapfrogtechnology/sync-db": "^2.0.0",
"knex": "^3.3.0",
"tedious": "^18.2.1",
"tedious": "^20.3.7",
"ts-node": "^10.9.2",
"typescript": "^6.0.3"
},
Expand Down
56 changes: 25 additions & 31 deletions examples/node-app-mssql-ts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
dependencies:
tslib "^2.6.2"

"@azure/core-auth@^1.10.0", "@azure/core-auth@^1.3.0", "@azure/core-auth@^1.7.2", "@azure/core-auth@^1.9.0":
"@azure/core-auth@^1.10.0", "@azure/core-auth@^1.10.1", "@azure/core-auth@^1.3.0", "@azure/core-auth@^1.9.0":
version "1.11.0"
resolved "https://registry.yarnpkg.com/@azure/core-auth/-/core-auth-1.11.0.tgz#1daeffdf62d1a871d22b865f9f3164a63ea1f575"
integrity sha512-IUZydyTUkDnYdstOW9pFOOUQlBjAepK5teihDE3x6yxsPJs/hsAaaYpeGxdxrgtOiJbBKSjKW7MDk7AEhb4LRg==
Expand Down Expand Up @@ -94,7 +94,7 @@
"@typespec/ts-http-runtime" "^0.3.0"
tslib "^2.6.2"

"@azure/identity@^4.2.1":
"@azure/identity@^4.13.1":
version "4.13.3"
resolved "https://registry.yarnpkg.com/@azure/identity/-/identity-4.13.3.tgz#f7781be089dc6231e17ae1454b9a1e91bc797b81"
integrity sha512-zGQPtqvXPgSA8yfV2CkIQ1qirqk0p9AIVpC5uEkdXQYcKl07QHvyaGYRnZOk0AsQUmxNb4wfkcwY5di8Z5xa9A==
Expand Down Expand Up @@ -126,7 +126,7 @@
"@azure/logger" "^1.1.4"
tslib "^2.2.0"

"@azure/keyvault-keys@^4.4.0":
"@azure/keyvault-keys@^4.10.2":
version "4.10.2"
resolved "https://registry.yarnpkg.com/@azure/keyvault-keys/-/keyvault-keys-4.10.2.tgz#4689ee3d7eb8e6e681bed0ed1f0549d6ec32ab61"
integrity sha512-VmUSLbXRAbSzDD8grXHGPaknYs0SKr3yuf6U+d4XMpX4XuVYskNqbTTwXce0zR1LyxfTZm9rWEBcvs3vdYwCmQ==
Expand Down Expand Up @@ -201,10 +201,10 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@js-joda/core@^5.6.1":
version "5.7.0"
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-5.7.0.tgz#526d437b07cbb41e28df34d487cbfccbe730185b"
integrity sha512-WBu4ULVVxySLLzK1Ppq+OdfP+adRS4ntmDQT915rzDJ++i95gc2jZkM5B6LWEAwN3lGXpfie3yPABozdD3K3Vg==
"@js-joda/core@^6.0.1":
version "6.3.0"
resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-6.3.0.tgz#9bc47b9b3cbdcc953c444f730e764c8d7a8f5b87"
integrity sha512-mdmjc6lJkTCORsHlMxBT9XM1yLqgtsNZmv/Hwme2v/HIb15D2XcmklZKTnynqBgsSizA9SkFvzpuksfIXhDV/w==

"@leapfrogtechnology/sync-db@^2.0.0":
version "2.3.1"
Expand Down Expand Up @@ -396,7 +396,7 @@
dependencies:
minimatch "*"

"@types/node@*", "@types/node@>=18":
"@types/node@*", "@types/node@>=22":
version "26.6.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-26.6.5.tgz#cb35209e7767c503551b5fa42a48231c7441d979"
integrity sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==
Expand Down Expand Up @@ -494,7 +494,7 @@ base64-js@^1.3.1:
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==

bl@^6.0.11:
bl@^6.1.4:
version "6.1.6"
resolved "https://registry.yarnpkg.com/bl/-/bl-6.1.6.tgz#b40f3aea6963c6742616a957efb742c4fb87ecbb"
integrity sha512-jLsPgN/YSvPUg9UX0Kd73CXpm2Psg9FxMeCSXnk3WBO3CMT10JMwijubhGfHCnFu6TPn1ei3b975dxv7K2pWVg==
Expand Down Expand Up @@ -816,10 +816,10 @@ https-proxy-agent@^7.0.0:
agent-base "^7.1.2"
debug "4"

iconv-lite@^0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
iconv-lite@^0.7.0:
version "0.7.3"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.3.tgz#84ee12f963e7de50bc01a13e160a078b3b0f415f"
integrity sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"

Expand Down Expand Up @@ -1233,11 +1233,6 @@ source-map@^0.6.0:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==

sprintf-js@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a"
integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==

sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
Expand Down Expand Up @@ -1283,21 +1278,20 @@ tarn@^3.0.2, tarn@^3.1.0:
resolved "https://registry.yarnpkg.com/tarn/-/tarn-3.1.2.tgz#d2922d34a232c8b027605f3873a9c55318ce4f34"
integrity sha512-3RTvqKZcK/17jnJ8rMKFXbyNogywTs1z0gVPPwFsJGX46rkmUHOdIaSQ/aVO1rS7nH+soiXiWk7rvUXxndm8Dg==

tedious@^18.2.1:
version "18.6.2"
resolved "https://registry.yarnpkg.com/tedious/-/tedious-18.6.2.tgz#c7da62ae11b0961177559b1c4f1c4d8dfa75ec2c"
integrity sha512-g7jC56o3MzLkE3lHkaFe2ZdOVFBahq5bsB60/M4NYUbocw/MCrS89IOEQUFr+ba6pb8ZHczZ/VqCyYeYq0xBAg==
dependencies:
"@azure/core-auth" "^1.7.2"
"@azure/identity" "^4.2.1"
"@azure/keyvault-keys" "^4.4.0"
"@js-joda/core" "^5.6.1"
"@types/node" ">=18"
bl "^6.0.11"
iconv-lite "^0.6.3"
tedious@^20.3.7:
version "20.3.7"
resolved "https://registry.yarnpkg.com/tedious/-/tedious-20.3.7.tgz#1b970d9c2e3fcd107e0ee9a78ce69f28878ec3a2"
integrity sha512-s+43djAcQGFiFHZPWtZPaDSZE/ukJnultjeJHXvKbM//OcZSSusSzXuqAIyOKpraNTWgtobhuWOvxrZK+a1yvA==
dependencies:
"@azure/core-auth" "^1.10.1"
"@azure/identity" "^4.13.1"
"@azure/keyvault-keys" "^4.10.2"
"@js-joda/core" "^6.0.1"
"@types/node" ">=22"
bl "^6.1.4"
iconv-lite "^0.7.0"
js-md4 "^0.3.2"
native-duplexpair "^1.0.0"
sprintf-js "^1.1.3"

tildify@2.0.0:
version "2.0.0"
Expand Down
10 changes: 9 additions & 1 deletion examples/node-app-pg-ts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
version: '3.3'
services:
db:
image: 'postgres:13-alpine'
image: 'postgres:18-alpine'
container_name: 'example-pg'
ports:
- '5432:5432'
environment:
POSTGRES_DB: 'testdb'
POSTGRES_USER: 'test'
POSTGRES_PASSWORD: 'secret'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U test -d testdb']
interval: 2s
timeout: 3s
retries: 30
app:
container_name: 'example-app'
build: .
depends_on:
db:
condition: service_healthy
environment:
DEBUG: 'sync-db*'
2 changes: 1 addition & 1 deletion examples/node-app-pg-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dependencies": {
"@leapfrogtechnology/sync-db": "^2.0.0",
"knex": "^3.3.0",
"pg": "^8.5.1",
"pg": "^8.23.1",
"ts-node": "^10.9.2",
"typescript": "^6.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/node-app-pg-ts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ pg-types@2.2.0:
postgres-date "~1.0.4"
postgres-interval "^1.1.0"

pg@^8.5.1:
pg@^8.23.1:
version "8.23.1"
resolved "https://registry.yarnpkg.com/pg/-/pg-8.23.1.tgz#e4848051a04aa2f968fd5671d075f89e5e7918b9"
integrity sha512-aL96AHANtWjPLDOLqnhx+ngp9+UK7ETEU8VJrDCGvsSSi/mGLcWYsS6Herg7lmaBJe4uwrfqsa7gTEFaSizDoQ==
Expand Down
Loading