-
Notifications
You must be signed in to change notification settings - Fork 18
141 lines (114 loc) · 4.3 KB
/
check.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Check
on:
pull_request:
paths:
- ".cargo"
- ".github/workflows/check.yml"
- "crates/**"
- "src/**"
- "build.rs"
- "Cargo.lock"
- "Cargo.toml"
- "rust-toolchain.toml"
- "rustfmt.toml"
- "taplo.toml"
- "vchord.control"
push:
paths:
- ".cargo"
- ".github/workflows/lint.yml"
- "crates/**"
- "src/**"
- "build.rs"
- "Cargo.lock"
- "Cargo.toml"
- "rust-toolchain.toml"
- "rustfmt.toml"
- "taplo.toml"
- "vchord.control"
merge_group:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
SCCACHE_GHA_ENABLED: true
RUSTC_WRAPPER: sccache
RUSTFLAGS: "-Dwarnings"
jobs:
style:
runs-on: "ubuntu-24.04"
steps:
- name: Set up Environment
run: |
curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-$(uname -m).gz | gzip -d - | install -m 755 /dev/stdin /usr/local/bin/taplo
- name: Checkout
uses: actions/checkout@v4
- name: Typos
uses: crate-ci/typos@master
- name: Taplo
run: taplo fmt --check
- name: Ruff
uses: astral-sh/ruff-action@v1
- name: Rustfmt
run: cargo fmt --check
lint:
strategy:
matrix:
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"]
runs-on: ${{ matrix.runner }}
steps:
- name: Set up Sccache
uses: mozilla-actions/sccache-action@v0.0.7
- name: Checkout
uses: actions/checkout@v4
- name: Clippy
run: cargo clippy --workspace --exclude vchord
- name: Cargo Test
run: cargo test --workspace --exclude vchord --no-fail-fast
psql:
strategy:
matrix:
version: ["13", "14", "15", "16", "17"]
runner: ["ubuntu-24.04", "ubuntu-24.04-arm"]
exclude:
- version: "13"
runner: "ubuntu-24.04"
- version: "13"
runner: "ubuntu-24.04-arm"
runs-on: ${{ matrix.runner }}
steps:
- name: Set up Environment
run: |
sudo apt-get remove -y '^postgres.*' '^libpq.*'
sudo apt-get purge -y '^postgres.*' '^libpq.*'
sudo update-alternatives --install /usr/bin/clang clang $(which clang-18) 255
sudo apt-get install -y postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
sudo apt-get install -y postgresql-server-dev-${{ matrix.version }}
sudo apt-get install -y postgresql-${{ matrix.version }} postgresql-${{ matrix.version }}-pgvector
echo "local all all trust" | sudo tee /etc/postgresql/${{ matrix.version }}/main/pg_hba.conf
echo "host all all 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/${{ matrix.version }}/main/pg_hba.conf
echo "host all all ::1/128 trust" | sudo tee -a /etc/postgresql/${{ matrix.version }}/main/pg_hba.conf
sudo -iu postgres createuser -s -r $USER
sudo -iu postgres createdb -O $USER $USER
sudo -iu postgres psql -c 'ALTER SYSTEM SET shared_preload_libraries = "vchord.so"'
sudo systemctl stop postgresql
curl -fsSL https://github.com/tensorchord/pgrx/releases/download/v0.12.9/cargo-pgrx-v0.12.9-$(uname -m)-unknown-linux-musl.tar.gz | tar -xOzf - ./cargo-pgrx | install -m 755 /dev/stdin /usr/local/bin/cargo-pgrx
cargo pgrx init --pg${{ matrix.version }}=$(which pg_config)
curl -fsSL https://github.com/risinglightdb/sqllogictest-rs/releases/download/v0.26.4/sqllogictest-bin-v0.26.4-$(uname -m)-unknown-linux-musl.tar.gz | tar -xOzf - ./sqllogictest | install -m 755 /dev/stdin /usr/local/bin/sqllogictest
- name: Set up Sccache
uses: mozilla-actions/sccache-action@v0.0.7
- name: Checkout
uses: actions/checkout@v4
- name: Clippy
run: cargo clippy -p vchord --features pg${{ matrix.version }} -- --no-deps
- name: Install
run: cargo pgrx install -p vchord --features pg${{ matrix.version }} --release --sudo
- name: Sqllogictest
run: |
sudo systemctl start postgresql
psql -c 'CREATE EXTENSION IF NOT EXISTS vchord CASCADE;'
sqllogictest --db $USER --user $USER './tests/**/*.slt'