-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
87 lines (83 loc) · 2.7 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: 'Setup pgvector'
description: 'Setup pgvector in GitHub Actions'
inputs:
postgres-version:
description: 'PostgreSQL version to use'
required: false
default: '17'
pgvector-version:
description: 'pgvector version to install'
required: false
default: '0.8.0'
postgres-user:
description: 'PostgreSQL user to create'
required: false
default: 'postgres'
postgres-password:
description: 'PostgreSQL user password'
required: false
default: 'postgres'
postgres-db:
description: 'PostgreSQL database to create'
required: false
default: 'postgres'
runs:
using: "composite"
steps:
- name: Install and Configure PostgreSQL on Ubuntu
if: runner.os == 'Linux'
shell: bash
run: |
chmod +x ${{ github.action_path }}/scripts/install-ubuntu.sh
${{ github.action_path }}/scripts/install-ubuntu.sh \
${{ inputs.postgres-version }} \
${{ inputs.pgvector-version }} \
${{ inputs.postgres-user }} \
${{ inputs.postgres-password }} \
${{ inputs.postgres-db }}
- name: Install and Configure PostgreSQL on macOS
if: runner.os == 'macOS'
shell: bash
run: |
chmod +x ${{ github.action_path }}/scripts/install-macos.sh
${{ github.action_path }}/scripts/install-macos.sh \
${{ inputs.postgres-version }} \
${{ inputs.pgvector-version }} \
${{ inputs.postgres-user }} \
${{ inputs.postgres-password }} \
${{ inputs.postgres-db }}
- name: Setup MSYS2
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: >-
mingw-w64-x86_64-postgresql
mingw-w64-x86_64-gcc
mingw-w64-x86_64-make
mingw-w64-x86_64-tools-git
make
diffutils
git
- name: Add MSYS2 to PATH
if: runner.os == 'Windows'
shell: pwsh
run: |
echo "D:\a\_temp\msys64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "D:\a\_temp\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install and Configure PostgreSQL on Windows
if: runner.os == 'Windows'
shell: msys2 {0}
env:
MSYSTEM: MINGW64
CHERE_INVOKING: 1
run: |
SCRIPT_PATH=$(echo "${{ github.action_path }}/scripts/install-windows.sh" | sed 's/\\/\//g')
chmod +x "$SCRIPT_PATH"
"$SCRIPT_PATH" \
${{ inputs.postgres-version }} \
${{ inputs.pgvector-version }} \
${{ inputs.postgres-user }} \
${{ inputs.postgres-password }} \
${{ inputs.postgres-db }}