Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cpunion committed Dec 9, 2024
0 parents commit 38fb3b4
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Setup pgvector Action

This action sets up [pgvector](https://github.com/pgvector/pgvector) in your GitHub Actions workflow. It uses the preinstalled PostgreSQL on GitHub runners and installs pgvector using platform-specific methods.

## Usage

```yaml
steps:
- uses: actions/checkout@v4
- uses: cpunion/setup-pgvector@v1
with:
postgres-version: '17' # optional, defaults to 17. Use 14 for ubuntu-22.04 and ubuntu-20.04
```
## Inputs
- `postgres-version`: PostgreSQL version to use (default: '17'). Note: Use '14' for ubuntu-22.04 and ubuntu-20.04.

## Platform Support

This action supports all major GitHub Actions platforms:
- Ubuntu (using postgresql-xx-pgvector package)
- macOS (using Homebrew)
- Windows (building from source using Visual Studio Build Tools)

## CI Status

The action is tested on the following platforms:
- Ubuntu: ubuntu-latest, ubuntu-24.04
- Windows: windows-latest, windows-2019
- macOS: macos-latest, macos-13

## Example workflows

### Ubuntu
```yaml
name: Test Ubuntu
on: [push]
jobs:
test:
runs-on: ubuntu-latest # or ubuntu-22.04, ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Setup pgvector
uses: cpunion/setup-pgvector@v1
with:
postgres-version: '17' # Use '14' for ubuntu-22.04 and ubuntu-20.04
- name: Create extension
run: |
sudo -u postgres psql -c 'CREATE EXTENSION vector;'
```

### macOS
```yaml
name: Test macOS
on: [push]
jobs:
test:
runs-on: macos-latest # or macos-13
steps:
- uses: actions/checkout@v4
- name: Setup pgvector
uses: cpunion/setup-pgvector@v1
- name: Create extension
run: |
psql postgres -c 'CREATE EXTENSION vector;'
```

### Windows
```yaml
name: Test Windows
on: [push]
jobs:
test:
strategy:
matrix:
os: [windows-latest, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup pgvector
uses: cpunion/setup-pgvector@v1
- name: Create extension
shell: cmd
run: |
psql -U postgres -c "CREATE EXTENSION vector;"
```

## License

MIT

0 comments on commit 38fb3b4

Please sign in to comment.