feat(server): implement PostgreSQL backend for Database + repositorie… #65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Server CI (using embeddings) | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - .github/workflows/ci-server-embeddings.yaml | |
| - schema/** | |
| - server/** | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - .github/workflows/ci-server-embeddings.yaml | |
| - schema/** | |
| - server/** | |
| permissions: | |
| contents: read | |
| jobs: | |
| schema: | |
| name: Validate schemas | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| - name: Validate fixtures against schemas | |
| run: make validate-schema | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| enable-cache: true | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: server/frontend/pnpm-lock.yaml | |
| - name: Setup and lint | |
| run: make setup-server lint-server | |
| test: | |
| name: Test | |
| needs: [schema, lint] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: server/frontend/pnpm-lock.yaml | |
| - name: Cache ModernBERT encoderfile | |
| id: cache-modernbert-encoderfile | |
| uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0 | |
| with: | |
| path: ${{ github.workspace }}/.cache/encoderfiles | |
| key: ${{ runner.os }}-modernbert-encoderfile-v1 | |
| - name: Download ModernBERT encoderfile | |
| if: steps.cache-modernbert-encoderfile.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p "${GITHUB_WORKSPACE}/.cache/encoderfiles" | |
| curl -fL --retry 3 --retry-delay 2 \ | |
| "https://huggingface.co/mozilla-ai/embedding-modernbert-encoderfile/resolve/main/modernbert.x86_64-unknown-linux-gnu.encoderfile" \ | |
| -o "${GITHUB_WORKSPACE}/.cache/encoderfiles/modernbert.x86_64-unknown-linux-gnu.encoderfile" | |
| - name: Prepare ModernBERT encoderfile | |
| run: | | |
| chmod +x "${GITHUB_WORKSPACE}/.cache/encoderfiles/modernbert.x86_64-unknown-linux-gnu.encoderfile" | |
| ls -lh "${GITHUB_WORKSPACE}/.cache/encoderfiles/modernbert.x86_64-unknown-linux-gnu.encoderfile" | |
| - name: Setup and test | |
| run: | | |
| "${GITHUB_WORKSPACE}/.cache/encoderfiles/modernbert.x86_64-unknown-linux-gnu.encoderfile" serve > /tmp/encoderfile.log 2>&1 & | |
| # Wait for the encoder health endpoint before running tests. | |
| for i in {1..60}; do | |
| if curl -fsS "http://127.0.0.1:8080/health" > /dev/null; then | |
| echo "Encoderfile health check passed" | |
| break | |
| fi | |
| if [ "$i" -eq 60 ]; then | |
| echo "Encoderfile did not become healthy in time" | |
| echo "Last 100 lines of encoderfile logs:" | |
| tail -n 100 /tmp/encoderfile.log || true | |
| exit 1 | |
| fi | |
| sleep 1 | |
| done | |
| export TOKEN_EMBEDDING_URL=http://127.0.0.1:8080 | |
| make setup-server test-server |