Skip to content

Commit 8023af0

Browse files
committed
feat: kinda curious how clippy will pan out
1 parent b57d30f commit 8023af0

File tree

2 files changed

+68
-17
lines changed

2 files changed

+68
-17
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
PGRX_VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[]|select(.name=="pgrx")|.version')
4444
cargo install --locked --version=$PGRX_VERSION cargo-pgrx --debug --force
4545
cargo pgrx init --pg14 $(which pg_config)
46-
- name: Install TypeID/PRQL
46+
- name: Install TypeID/pgrx
4747
run: |
4848
cargo pgrx install --no-default-features --release --sudo
4949
- name: Start PostgreSQL
@@ -63,19 +63,4 @@ jobs:
6363
- name: Checkout code
6464
uses: actions/checkout@v4
6565
- name: Run rustfmt
66-
run: cargo fmt -- --check
67-
rust-clippy:
68-
runs-on: ubuntu-latest
69-
strategy:
70-
matrix:
71-
pg: [ "16" ]
72-
steps:
73-
- name: Checkout code
74-
uses: actions/checkout@v4
75-
- name: Install cargo-pgrx
76-
run: |
77-
PGRX_VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[]|select(.name=="pgrx")|.version')
78-
cargo install --locked --version=$PGRX_VERSION cargo-pgrx --debug --force
79-
cargo pgrx init --pg${{ matrix.pg }} download
80-
- name: Run clippy
81-
run: cargo clippy --all-targets --no-default-features --features pg${{ matrix.pg }} -- -D warnings
66+
run: cargo fmt -- --check

.github/workflows/clippy.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# rust-clippy is a tool that runs a bunch of lints to catch common
6+
# mistakes in your Rust code and help improve your Rust code.
7+
# More details at https://github.com/rust-lang/rust-clippy
8+
# and https://rust-lang.github.io/rust-clippy/
9+
10+
name: rust-clippy analyze
11+
12+
on:
13+
push:
14+
branches: [ "main" ]
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: [ "main" ]
18+
schedule:
19+
- cron: '20 14 * * 5'
20+
21+
jobs:
22+
rust-clippy-analyze:
23+
name: Run rust-clippy analyzing
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
matrix:
28+
pg: [ "16" ]
29+
permissions:
30+
contents: read
31+
security-events: write
32+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Install Rust toolchain
38+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
39+
with:
40+
profile: minimal
41+
toolchain: stable
42+
components: clippy
43+
override: true
44+
45+
46+
- name: Install cargo-pgrx
47+
run: |
48+
PGRX_VERSION=$(cargo metadata --format-version 1 | jq -r '.packages[]|select(.name=="pgrx")|.version')
49+
cargo install --locked --version=$PGRX_VERSION cargo-pgrx --debug --force
50+
cargo pgrx init --pg${{ matrix.pg }} download
51+
52+
- name: Install required cargo
53+
run: cargo install clippy-sarif sarif-fmt
54+
55+
- name: Run rust-clippy
56+
run:
57+
cargo clippy
58+
--all-features
59+
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
60+
continue-on-error: true
61+
62+
- name: Upload analysis results to GitHub
63+
uses: github/codeql-action/upload-sarif@v1
64+
with:
65+
sarif_file: rust-clippy-results.sarif
66+
wait-for-processing: true

0 commit comments

Comments
 (0)