Skip to content

Commit

Permalink
Build on ARM
Browse files Browse the repository at this point in the history
Fixes #85
  • Loading branch information
cevian committed Jun 26, 2024
1 parent 8173d2a commit 2882c1b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/actions/install-pgrx/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-pgrx
key: ${{runner.os}}-cargo-pgrx-${{ inputs.pgrx-version }}-pg${{ steps.pg-config.outputs.version }}-${{ steps.rustc.outputs.version }}
key: ${{ runner.arch }}-${{runner.os}}-cargo-pgrx-${{ inputs.pgrx-version }}-pg${{ steps.pg-config.outputs.version }}-${{ steps.rustc.outputs.version }}

- name: Install cargo-pgrx ${{ inputs.pgrx-version }}
if: steps.cache-cargo-pgrx.outputs.cache-hit != 'true'
Expand All @@ -63,7 +63,7 @@ runs:
uses: actions/cache@v4
with:
path: ~/.cargo/bin/grcov
key: ${{runner.os}}-cargo-grcov-${{ inputs.grcov-version }}-${{ steps.rustc.outputs.version }}
key: ${{ runner.arch }}-${{runner.os}}-cargo-grcov-${{ inputs.grcov-version }}-${{ steps.rustc.outputs.version }}

- name: Install grcov
if: steps.cache-cargo-grcov.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install-postgres/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runs:
uses: actions/cache@v4
with:
path: ${{ inputs.pg-src-dir }}
key: ${{ runner.os }}-postgresql-${{ inputs.pg-version }}
key: ${{ runner.arch }}-${{ runner.os }}-postgresql-${{ inputs.pg-version }}

- name: Build PostgreSQL
if: steps.cache-postgresql.outputs.cache-hit != 'true'
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/deb-packager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@ on:

jobs:
packager:
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs_on }}

strategy:
fail-fast: false
matrix:
platform: [ amd64, arm64 ]
include:
- platform: amd64
runs_on: ubuntu-latest
rustflags: '-C target-feature=+avx2,+fma'
- platform: arm64
runs_on: cloud-image-runner-arm64
rustflags: ''

env:
PG_VER: ${{ github.event.inputs.PG }}
PG_MIN_VER: ${{ github.event.inputs.PG_MIN }}
Expand All @@ -42,7 +55,7 @@ jobs:

- name: Install Deb builder specific packages
run: |
sudo apt-get install dpkg-dev debhelper
sudo apt-get install dpkg-dev debhelper build-essential
- name: Install PostgreSQL ${{ env.PG_VER }}
uses: ./.github/actions/install-postgres
Expand All @@ -68,13 +81,13 @@ jobs:
id: debbuild
run: |
export PATH=~/${{ env.PG_INSTALL_DIR }}/bin:$PATH
(cd ${{ env.TAG_DIR }} && make package)
(cd ${{ env.TAG_DIR }} && ${{ matrix.rustflags != '' && format('RUSTFLAGS="{0}"', matrix.rustflags) || '' }} make package)
bash scripts/package-deb.sh "${{ env.TAG }}" "${PWD}/${{ env.TAG_DIR }}" "$RUNNER_OS" "${{ env.PG_VER }}"
# Use a GH artifact, then we can make use of the (quite limited) GH API https://docs.github.com/en/rest/actions/artifacts
# The artifact will have a TTL of 90 days
- name: Upload deb as Artifact
uses: actions/upload-artifact@v4
with:
name: pgvectorscale-${{ env.TAG }}-pg${{ env.PG_VER }}
name: pgvectorscale-${{ env.TAG }}-pg${{ env.PG_VER }}-${{ matrix.platform }}
path: pkgdump/pgvectorscale-*${{ env.TAG }}*.deb
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ PG_REGRESS_OPTS_EXTRA=--create-role=superuser,tsdbadmin,test_role_1 --launcher=
export TEST_OUTPUT_DIR:=$(ROOTDIR)/test_output
export PG_ABS_SRCDIR:=$(ROOTDIR)/test
export TEST_DBNAME:=regression
export RUSTFLAGS:=-C target-feature=+avx2,+fma

### default collation settings on Cloud is C.UTF-8
PG_DEFAULT_REGRESS_LOCALE=$(shell uname | grep -q 'Darwin' && echo 'en_US.UTF-8' || echo 'C.UTF-8')
Expand Down

0 comments on commit 2882c1b

Please sign in to comment.