This repository was archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
96 lines (78 loc) · 2.83 KB
/
lint.yaml
File metadata and controls
96 lines (78 loc) · 2.83 KB
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
name: lint
on:
pull_request:
paths-ignore:
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: dtolnay/rust-toolchain@1.64.0
with:
components: rustfmt, clippy
- run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_BUCKET: promscale-extension-sccache
AWS_ACCESS_KEY_ID: ${{ secrets.PROMSCALE_EXTENSION_SCCACHE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROMSCALE_EXTENSION_SCCACHE_AWS_SECRET_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
- name: Install rust
uses: dtolnay/rust-toolchain@1.64.0
with:
components: rustfmt, clippy
- name: Setup sccache
run: |
curl -L "https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz" | tar zxf -
chmod +x sccache-*/sccache
sudo mv sccache-*/sccache /usr/local/bin/sccache
sccache --show-stats
- uses: Swatinem/rust-cache@v2
- name: Install cargo-pgx
run: |
./install-cargo-pgx.sh
- name: Initialize pgx
run: cargo pgx init --pg15 download
- run: cargo clippy --no-default-features --features pg15 -- -D warnings
pgspot:
runs-on: ubuntu-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_BUCKET: promscale-extension-sccache
AWS_ACCESS_KEY_ID: ${{ secrets.PROMSCALE_EXTENSION_SCCACHE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PROMSCALE_EXTENSION_SCCACHE_AWS_SECRET_ACCESS_KEY }}
steps:
- name: Install rust
uses: dtolnay/rust-toolchain@1.64.0
with:
components: rustfmt, clippy
- name: Checkout extension code
uses: actions/checkout@v3
- name: Setup python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install pgspot
run: pip install pgspot==0.3.3
- name: Setup sccache
run: |
curl -L "https://github.com/mozilla/sccache/releases/download/v0.2.15/sccache-v0.2.15-x86_64-unknown-linux-musl.tar.gz" | tar zxf -
chmod +x sccache-*/sccache
sudo mv sccache-*/sccache /usr/local/bin/sccache
sccache --show-stats
- uses: Swatinem/rust-cache@v2
- name: Install cargo-pgx
run: |
./install-cargo-pgx.sh
- name: Initialize pgx
run: cargo pgx init --pg15 download
- name: Prepare control file
run: make promscale.control
- name: Generate schema
run: cargo pgx schema pg15 --out /tmp/schema.sql
- name: Run pgspot
run: pgspot --sql-accepting=execute_everywhere --sql-accepting=distributed_exec --ignore PS005 /tmp/schema.sql ./sql/promscale--0.0.0.sql