-
Notifications
You must be signed in to change notification settings - Fork 10
66 lines (62 loc) · 1.93 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
name: Rust
on:
push:
branches: ["main"]
paths:
- ".cargo/**"
- ".github/**"
- "src/**"
- "Cargo.lock"
- "Cargo.toml"
- "pg_bestmatch.control"
pull_request:
branches: ["main"]
paths:
- ".cargo/**"
- ".github/**"
- "src/**"
- "Cargo.lock"
- "Cargo.toml"
- "pg_bestmatch.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:
check:
strategy:
matrix:
version: [12, 13, 14, 15, 16]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- 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 update
sudo apt-get install -y build-essential
- name: Set up Sccache
uses: mozilla-actions/[email protected]
- name: Set up PostgreSQL
run: |
sudo apt-get install -y postgresql-common
echo | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt update
sudo apt-get install -y postgresql-${{ matrix.version }} postgresql-server-dev-${{ matrix.version }}
- name: Set up Pgrx
run: |
cargo install cargo-pgrx --debug --branch v0.12.0-alpha.1-patch2 --git https://github.com/tensorchord/pgrx.git
cargo pgrx init --pg${{ matrix.version }}=$(which pg_config)
- name: Clippy
run: cargo clippy --lib --features "pg${{ matrix.version }}"
- name: Build
run: cargo build --lib --features "pg${{ matrix.version }}"