Skip to content

Commit

Permalink
Split steps into separate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 21, 2024
1 parent 23a1813 commit 38ee09d
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 68 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/step-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: mac
on:
push:
paths:
- .github/workflows/step-mac.yml
jobs:
mac:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-15, macos-14, macos-13]
steps:
- run: brew install postgresql@17
- run: brew link --overwrite postgresql@17
- name: Install pgvector
run: brew install pgvector
- run: brew services start postgresql@17 && sleep 1
- run: psql -d postgres -c 'CREATE EXTENSION vector'
25 changes: 25 additions & 0 deletions .github/workflows/step-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: ubuntu
on:
push:
paths:
- .github/workflows/step-ubuntu.yml
jobs:
ubuntu:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
postgres: 16
- os: ubuntu-22.04
postgres: 14
- os: ubuntu-20.04
postgres: 14
steps:
- name: Install pgvector
run: |
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
sudo apt-get install postgresql-${{ matrix.postgres }}-pgvector
- run: sudo systemctl start postgresql
- run: sudo -u postgres psql -c 'CREATE EXTENSION vector'
31 changes: 31 additions & 0 deletions .github/workflows/step-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: windows
on:
push:
paths:
- .github/workflows/step-windows.yml
jobs:
windows:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
vs: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
- os: windows-2019
vs: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
steps:
- name: Install pgvector
run: |
call "${{ matrix.vs }}\VC\Auxiliary\Build\vcvars64.bat"
cd %TEMP%
git clone --branch v0.7.4 https://github.com/pgvector/pgvector.git
cd pgvector
nmake /NOLOGO /F Makefile.win
nmake /NOLOGO /F Makefile.win install
shell: cmd
- run: sc config postgresql-x64-14 start=auto
- run: net start postgresql-x64-14
- run: |
"%PGBIN%/psql" -d postgres -c "CREATE EXTENSION vector"
shell: cmd
63 changes: 0 additions & 63 deletions .github/workflows/step.yml

This file was deleted.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[pgvector](https://github.com/pgvector/pgvector) instructions for GitHub Actions

[![Build Status](https://github.com/pgvector/setup-pgvector/actions/workflows/step.yml/badge.svg?branch=master)](https://github.com/pgvector/setup-pgvector/actions) [![Build Status](https://github.com/pgvector/setup-pgvector/actions/workflows/service.yml/badge.svg?branch=master)](https://github.com/pgvector/setup-pgvector/actions)
[![Build Status](https://github.com/pgvector/setup-pgvector/actions/workflows/step-ubuntu.yml/badge.svg?branch=master)](https://github.com/pgvector/setup-pgvector/actions) [![Build Status](https://github.com/pgvector/setup-pgvector/actions/workflows/step-mac.yml/badge.svg?branch=master)](https://github.com/pgvector/setup-pgvector/actions) [![Build Status](https://github.com/pgvector/setup-pgvector/actions/workflows/step-windows.yml/badge.svg?branch=master)](https://github.com/pgvector/setup-pgvector/actions) [![Build Status](https://github.com/pgvector/setup-pgvector/actions/workflows/service.yml/badge.svg?branch=master)](https://github.com/pgvector/setup-pgvector/actions)

## Getting Started

Expand All @@ -15,7 +15,7 @@ First, choose your installation method:

To add to the preinstalled Postgres installation on [runner images](https://github.com/actions/runner-images#available-images), add a step to your workflow.

Ubuntu
#### Ubuntu

```yml
- name: Install pgvector
Expand All @@ -26,14 +26,18 @@ Ubuntu
Note: Replace `16` with your Postgres server version

Mac
See a [full example](https://github.com/pgvector/setup-pgvector/blob/master/.github/workflows/step-ubuntu.yml)

#### Mac

```yml
- name: Install pgvector
run: brew install pgvector
```

Windows
See a [full example](https://github.com/pgvector/setup-pgvector/blob/master/.github/workflows/step-mac.yml)

#### Windows

```yml
- name: Install pgvector
Expand All @@ -49,7 +53,7 @@ Windows

Note: Use `C:\Program Files (x86)\Microsoft Visual Studio\2019` for `windows-2019`

See a [full example](https://github.com/pgvector/setup-pgvector/blob/master/.github/workflows/step.yml)
See a [full example](https://github.com/pgvector/setup-pgvector/blob/master/.github/workflows/step-windows.yml)

### Service

Expand Down

0 comments on commit 38ee09d

Please sign in to comment.