forked from paradedb/paradedb
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.5 KB
/
lint-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
# workflows/lint-rust.yml
#
# Lint Rust
# Lint Rust files using Clippy and Rustfmt.
name: Lint Rust
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.rs"
- ".github/workflows/lint-rust.yml"
workflow_dispatch:
concurrency:
group: lint-rust-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint-rust:
name: Lint Rust Files
runs-on: depot-ubuntu-latest-2
if: github.event.pull_request.draft == false
strategy:
matrix:
pg_version: [16]
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Install & Configure Supported PostgreSQL Version
run: |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update && sudo apt-get install -y postgresql-${{ matrix.pg_version }} postgresql-server-dev-${{ matrix.pg_version }}
- name: Install pgrx
run: cargo install --locked cargo-pgrx --version 0.11.3
- name: Initialize pgrx for Current PostgreSQL Version
run: cargo pgrx init --pg${{ matrix.pg_version }}=/usr/lib/postgresql/${{ matrix.pg_version }}/bin/pg_config
- name: Run Rustfmt
run: cargo fmt -- --check
- name: Run Clippy
run: cargo clippy --workspace --all-targets -- -D warnings --no-deps