Skip to content

feat: PostgreSQL sink backend #10460

feat: PostgreSQL sink backend

feat: PostgreSQL sink backend #10460

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: CI
on:
push:
branches: [main, feat/postgres]
pull_request:
branches: [main, feat/postgres]
permissions:
pull-requests: write
jobs:
build-ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [22.x, 24.x]
mongodb-version: ['6.0', '7.0', '8.0']
# PostgreSQL service container for the postgres integration tests. A
# single version (postgres:16) keeps the lane fast; a broader version
# matrix can follow later if needed.
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: git_proxy_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@315db7fe45ac2880b7758f1933e6e5d59afd5e94 # 1.12.1
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Install dependencies
run: npm ci --no-fund
# for now only check the types of the server
# tsconfig isn't quite set up right to respect what vite accepts
# for the frontend code
- name: Check Types (Server)
run: npm run check-types:server
- name: Build TypeScript
run: npm run build-ts
- name: Build CLI
run: |
npm run build -w @finos/git-proxy-cli
npm rebuild @finos/git-proxy-cli
- name: Test
id: test
run: |
npm run test-coverage-ci
npm run test-coverage-ci --workspaces --if-present
- name: MongoDB Integration Tests
env:
RUN_MONGO_TESTS: 'true'
GIT_PROXY_MONGO_CONNECTION_STRING: mongodb://localhost:27017/git-proxy-test
run: npm run test:integration
- name: PostgreSQL Integration Tests
env:
RUN_POSTGRES_TESTS: 'true'
GIT_PROXY_POSTGRES_CONNECTION_STRING: postgresql://postgres:postgres@localhost:5432/git_proxy_test
run: npm run test:integration:postgres
- name: Upload test coverage report
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: ./coverage/lcov.info,./coverage-cli/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
- name: Build frontend
run: npm run build-ui
- name: Run cypress test
uses: cypress-io/github-action@c32f12761482a282d24ca0fd7466d8ae86f54ba8 # v7.4.2
with:
# skip the action's internal npm ci — dependencies are already installed above
install: false
start: npm start &
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
command: npm run cypress:run
# Windows build - single combination for development support
build-windows:
runs-on: windows-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- name: Use Node.js 24.x
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.x
- name: Enable Windows Developer Mode
shell: powershell
run: |
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
- name: Install dependencies
run: npm ci --no-fund
- name: Check Types (Server)
run: npm run check-types:server
- name: Build TypeScript
run: npm run build-ts
- name: Build CLI
run: |
npm run build -w @finos/git-proxy-cli
npm rebuild @finos/git-proxy-cli
- name: Test
id: test
shell: bash
run: |
npm run test-coverage-ci
npm run test-coverage-ci --workspaces --if-present
- name: Build frontend
run: npm run build-ui
# Execute a final job to collect the results and report a single check status
results:
if: ${{ always() }}
runs-on: ubuntu-latest
name: build result
needs: [build-ubuntu, build-windows]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0
with:
egress-policy: audit
- name: Check build results
run: |
ubuntu_result="${{ needs.build-ubuntu.result }}"
windows_result="${{ needs.build-windows.result }}"
if [[ ($ubuntu_result == "success" || $ubuntu_result == "skipped") && ($windows_result == "success" || $windows_result == "skipped") ]]; then
echo "### ✅ All builds passed" >> $GITHUB_STEP_SUMMARY
exit 0
else
echo "### ❌ Some builds failed" >> $GITHUB_STEP_SUMMARY
echo "- Ubuntu: $ubuntu_result" >> $GITHUB_STEP_SUMMARY
echo "- Windows: $windows_result" >> $GITHUB_STEP_SUMMARY
exit 1
fi
- name: Parse failed matrix jobs
if: needs.build-ubuntu.result == 'failure' || needs.build-windows.result == 'failure'
run: |
echo "## Failed Matrix Combinations" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| OS | Node Version | MongoDB Version | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----|--------------|-----------------|--------|" >> $GITHUB_STEP_SUMMARY
# Since we can't directly get individual matrix job statuses,
# we'll note that the build job failed
echo "| Multiple | Multiple | Multiple | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "⚠️ Check the [build job logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details on which specific matrix combinations failed." >> $GITHUB_STEP_SUMMARY