From 38ee09d9da914e2338246374fb5986ed18b18a33 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 21 Oct 2024 16:07:18 -0700 Subject: [PATCH] Split steps into separate workflows --- .github/workflows/step-mac.yml | 19 +++++++++ .github/workflows/step-ubuntu.yml | 25 ++++++++++++ .github/workflows/step-windows.yml | 31 +++++++++++++++ .github/workflows/step.yml | 63 ------------------------------ README.md | 14 ++++--- 5 files changed, 84 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/step-mac.yml create mode 100644 .github/workflows/step-ubuntu.yml create mode 100644 .github/workflows/step-windows.yml delete mode 100644 .github/workflows/step.yml diff --git a/.github/workflows/step-mac.yml b/.github/workflows/step-mac.yml new file mode 100644 index 0000000..af86763 --- /dev/null +++ b/.github/workflows/step-mac.yml @@ -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' diff --git a/.github/workflows/step-ubuntu.yml b/.github/workflows/step-ubuntu.yml new file mode 100644 index 0000000..2a476a1 --- /dev/null +++ b/.github/workflows/step-ubuntu.yml @@ -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' diff --git a/.github/workflows/step-windows.yml b/.github/workflows/step-windows.yml new file mode 100644 index 0000000..7e796cd --- /dev/null +++ b/.github/workflows/step-windows.yml @@ -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 diff --git a/.github/workflows/step.yml b/.github/workflows/step.yml deleted file mode 100644 index 17b9d6a..0000000 --- a/.github/workflows/step.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: step -on: - push: - paths: - - .github/workflows/step.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' - 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' - 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 diff --git a/README.md b/README.md index ab75555..aed30d8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 @@ -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