Skip to content

chore: type check and external test #166

chore: type check and external test

chore: type check and external test #166

Workflow file for this run

name: Rust
on:
pull_request:
paths:
- '.github/workflows/rust.yml'
- 'src/**'
- 'Cargo.lock'
- 'Cargo.toml'
- '*.control'
- 'rust-toolchain.toml'
push:
branches:
- main
paths:
- '.github/workflows/rust.yml'
- 'src/**'
- 'Cargo.lock'
- 'Cargo.toml'
- '*.control'
- 'rust-toolchain.toml'
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
arch: ["x86_64", "aarch64"]
env:
PGRX_IMAGE: "ghcr.io/tensorchord/vectorchord-pgrx:0.12.8"
steps:
- 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 docker images and permissions
run: |
docker pull $PGRX_IMAGE
echo "Default user: $(id -u):$(id -g)"
sudo chown -R 1000:1000 .
- name: Clippy
run: |
for v in {14..17}; do
docker run --rm -v .:/workspace $CACHE_ENVS $PGRX_IMAGE clippy --target ${{ matrix.arch }}-unknown-linux-gnu --features "pg$v" -- -D warnings
done
- name: Build
run: |
for v in {14..17}; do
docker run --rm -v .:/workspace $CACHE_ENVS $PGRX_IMAGE build --lib --target ${{ matrix.arch }}-unknown-linux-gnu --features "pg$v"
done
- name: Test
run: |
# pg agnostic tests
docker run --rm -v .:/workspace $CACHE_ENVS $PGRX_IMAGE test --no-fail-fast --target ${{ matrix.arch }}-unknown-linux-gnu --features pg17