Skip to content

Commit 20c83d5

Browse files
committed
Add test workflow
1 parent 8ab1e0b commit 20c83d5

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "Install pgvector "
2+
description: "Builds and installs Pgvector"
3+
4+
inputs:
5+
pgvector-version:
6+
required: true
7+
description: "pgvector version"
8+
pgvector-src-dir:
9+
default: pgvectorbuild
10+
pg-install-dir:
11+
default: postgresql
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
17+
- name: Build Pgvector ${{ inputs.pgvector-version }}
18+
shell: bash
19+
env:
20+
pg_build_args: --enable-debug --enable-cassert
21+
llvm_config: llvm-config-14
22+
CC: gcc
23+
CXX: g++
24+
run: |
25+
export PATH=${{ inputs.pg-install-dir }}/bin:$PATH
26+
mkdir -p ${{ inputs.pgvector-src-dir }}
27+
cd ${{ inputs.pgvector-src-dir }}
28+
git clone --branch v${{ inputs.pgvector-version }} https://github.com/pgvector/pgvector.git
29+
cd pgvector
30+
make -j$(nproc)
31+
32+
- name: Install pgvector ${{ inputs.pgvector-version }}
33+
shell: bash
34+
run: |
35+
export PATH=${{ inputs.pg-install-dir }}/bin:$PATH
36+
make -C ${{ inputs.pgvector-src-dir }}/pgvector install

.github/workflows/pgrx_test.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Run PGRX tests
2+
on: [push, pull_request, workflow_dispatch]
3+
permissions:
4+
contents: read
5+
6+
jobs:
7+
tester:
8+
runs-on: ${{ matrix.platform.runs_on }}
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
pgvector:
14+
- version: 0.7.4
15+
pg:
16+
- major: 15
17+
minor: 7
18+
- major: 16
19+
minor: 3
20+
platform:
21+
- type: amd64
22+
runs_on: ubuntu-latest
23+
rustflags: '-C target-feature=+avx2,+fma'
24+
- type: arm64
25+
runs_on: cloud-image-runner-arm64
26+
rustflags: ''
27+
28+
env:
29+
PG_SRC_DIR: pgbuild
30+
PG_INSTALL_DIR: postgresql
31+
MAKE_JOBS: 6
32+
PG_CONFIG_PATH: postgresql/bin/pg_config
33+
TAG: ${{ github.event.inputs.tag }}
34+
TAG_DIR: pgvectorscale
35+
TAG_GIT_REF: ${{ github.event.inputs.TAG_GIT_REF == '' && github.event.inputs.tag || github.event.inputs.TAG_GIT_REF}}
36+
37+
steps:
38+
- name: Checkout pgvectorscale
39+
uses: actions/checkout@v4
40+
41+
- name: Install Linux Packages
42+
uses: ./.github/actions/install-packages
43+
44+
- name: Install PostgreSQL ${{ matrix.pg.major }}
45+
uses: ./.github/actions/install-postgres
46+
with:
47+
pg-version: ${{ matrix.pg.major }}.${{ matrix.pg.minor }}
48+
pg-src-dir: ~/${{ env.PG_SRC_DIR }}
49+
pg-install-dir: ~/${{ env.PG_INSTALL_DIR }}
50+
51+
- name: Install pgvector ${{ matrix.pgvector.version }}
52+
uses: ./.github/actions/install-pgvector
53+
with:
54+
pgvector-version: ${{ matrix.pgvector.version }}
55+
pg-install-dir: ~/${{ env.PG_INSTALL_DIR }}
56+
57+
- name: Install pgrx
58+
uses: ./.github/actions/install-pgrx
59+
with:
60+
pg-install-dir: ~/${{ env.PG_INSTALL_DIR }}
61+
pgrx-version: 0.11.1
62+
63+
- name: Run tests
64+
id: runtests
65+
run: |
66+
cd pgvectorscale
67+
ls
68+
${{ matrix.platform.rustflags != '' && format('RUSTFLAGS="{0}"', matrix.platform.rustflags) || '' }} cargo pgrx test -- pg${{ matrix.pg.major }}

0 commit comments

Comments
 (0)