-
Notifications
You must be signed in to change notification settings - Fork 17
69 lines (64 loc) · 2.01 KB
/
rust.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
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