fix: release package name, version and licenses (#179) #231
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PostgresSQL | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/psql.yml' | |
- 'src/**' | |
- 'Cargo.lock' | |
- 'Cargo.toml' | |
- '*.control' | |
- 'rust-toolchain.toml' | |
- 'tests/**' | |
- 'tools/**' | |
push: | |
branches: | |
- main | |
paths: | |
- '.github/workflows/psql.yml' | |
- 'src/**' | |
- 'Cargo.lock' | |
- 'Cargo.toml' | |
- '*.control' | |
- 'rust-toolchain.toml' | |
- 'tests/**' | |
- 'tools/**' | |
merge_group: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
test: | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
matrix: | |
version: ["14", "15", "16", "17"] | |
runner: ["ubuntu-22.04", "ubuntu-22.04-arm"] | |
env: | |
PGRX_IMAGE: "ghcr.io/tensorchord/vectorchord-pgrx:0.12.9-nightly-2024-12-25" | |
SQLLOGICTEST: "0.25.0" | |
ARCH: ${{ matrix.runner == 'ubuntu-22.04' && 'x86_64' || 'aarch64' }} | |
PLATFORM: ${{ matrix.runner == 'ubuntu-22.04' && 'amd64' || 'arm64' }} | |
steps: | |
- name: Set up Environment | |
run: | | |
sudo apt-get remove -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*' | |
sudo apt-get purge -y '^postgres.*' '^libpq.*' '^clang.*' '^llvm.*' '^libclang.*' '^libllvm.*' '^mono-llvm.*' | |
sudo apt-get install -y postgresql-common | |
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y | |
sudo apt-get install -y postgresql-client-17 | |
- uses: actions/checkout@v4 | |
- name: Configure sccache | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const url = process.env.ACTIONS_CACHE_URL || ''; | |
const token = process.env.ACTIONS_RUNTIME_TOKEN || ''; | |
core.exportVariable( | |
'CACHE_ENVS', | |
`-e CARGO_INCREMENTAL=0 -e SCCACHE_GHA_ENABLED=true -e RUSTC_WRAPPER=sccache -e ACTIONS_CACHE_URL=${url} -e ACTIONS_RUNTIME_TOKEN=${token}`, | |
); | |
- name: Set up pgrx docker images and permissions | |
run: | | |
docker pull $PGRX_IMAGE | |
echo "Default user: $(id -u):$(id -g)" | |
sudo chmod -R 777 . | |
- name: Build | |
run: | | |
docker run --rm -v .:/workspace $CACHE_ENVS \ | |
-e SEMVER=0.0.0 \ | |
-e VERSION=${{ matrix.version }} \ | |
-e ARCH=$ARCH \ | |
-e PLATFORM=$PLATFORM \ | |
$PGRX_IMAGE ./tools/package.sh | |
docker build -t vchord:pg${{ matrix.version }} --build-arg PG_VERSION=${{ matrix.version }} --build-arg SEMVER=0.0.0 -f ./docker/Dockerfile . | |
- name: Setup SQL Logic Test | |
run: | | |
curl -fsSL -o sqllogictest.tar.gz https://github.com/risinglightdb/sqllogictest-rs/releases/download/v${SQLLOGICTEST}/sqllogictest-bin-v${SQLLOGICTEST}-$ARCH-unknown-linux-musl.tar.gz | |
tar -xzf sqllogictest.tar.gz | |
mv sqllogictest /usr/local/bin/ | |
- name: SQL Test | |
env: | |
PGPASSWORD: postgres | |
run: | | |
docker run --rm --name test -d -e POSTGRES_PASSWORD=${PGPASSWORD} -p 5432:5432 vchord:pg${{ matrix.version }} | |
sleep 5 | |
psql -h localhost -U postgres -d postgres -c 'CREATE EXTENSION IF NOT EXISTS vchord CASCADE;' | |
sqllogictest './tests/**/*.slt' | |
docker stop test |