@@ -13,6 +13,8 @@ concurrency:
1313env :
1414 CARGO_TERM_COLOR : always
1515 RUST_BACKTRACE : 1
16+ PGRX_VERSION : 0.14.3
17+ PG_VERSION : 16
1618
1719jobs :
1820 rust-formatting :
@@ -64,18 +66,18 @@ jobs:
6466 uses : actions/cache@v3
6567 with :
6668 path : ~/.cargo/bin/cargo-pgrx
67- key : ${{ runner.os }}-cargo-pgrx-0.14.3
69+ key : ${{ runner.os }}-cargo-pgrx-${{ env.PGRX_VERSION }}
6870 restore-keys : |
6971 ${{ runner.os }}-cargo-pgrx-
7072
7173 - name : Cache PostgreSQL installations
7274 uses : actions/cache@v3
7375 with :
7476 path : ~/.pgrx
75- key : ${{ runner.os }}-pgrx-pg16-0.14.3 -${{ hashFiles('**/Cargo.toml ') }}
77+ key : ${{ runner.os }}-pgrx-pg${{ env.PG_VERSION }}-${{ env.PGRX_VERSION }} -${{ hashFiles('**/Cargo.lock ') }}
7678 restore-keys : |
77- ${{ runner.os }}-pgrx-pg16-0.14.3 -
78- ${{ runner.os }}-pgrx-pg16 -
79+ ${{ runner.os }}-pgrx-pg${{ env.PG_VERSION }}-${{ env.PGRX_VERSION }} -
80+ ${{ runner.os }}-pgrx-pg${{ env.PG_VERSION }} -
7981
8082 - name : Install system dependencies
8183 run : |
@@ -85,12 +87,12 @@ jobs:
8587 - name : Install and initialize pgrx
8688 run : |
8789 if [ ! -f ~/.cargo/bin/cargo-pgrx ]; then
88- cargo install cargo-pgrx --version=0.14.3 --locked
89- cargo pgrx init --pg16=download
90+ cargo install cargo-pgrx --version=${PGRX_VERSION} --locked
9091 fi
92+ cargo pgrx info pg-config ${PG_VERSION} >/dev/null 2>&1 || cargo pgrx init --pg${PG_VERSION}=download
9193
9294 - name : Run Clippy
93- run : cargo clippy --all-targets --features pg16 -- -D warnings
95+ run : cargo clippy --all-targets --no-default-features -- features pg16 -- -D warnings
9496
9597 rust-tests :
9698 name : Rust Tests
@@ -122,18 +124,18 @@ jobs:
122124 uses : actions/cache@v3
123125 with :
124126 path : ~/.cargo/bin/cargo-pgrx
125- key : ${{ runner.os }}-cargo-pgrx-0.14.3
127+ key : ${{ runner.os }}-cargo-pgrx-${{ env.PGRX_VERSION }}
126128 restore-keys : |
127129 ${{ runner.os }}-cargo-pgrx-
128130
129131 - name : Cache PostgreSQL installations
130132 uses : actions/cache@v3
131133 with :
132134 path : ~/.pgrx
133- key : ${{ runner.os }}-pgrx-pg16-0.14.3 -${{ hashFiles('**/Cargo.toml ') }}
135+ key : ${{ runner.os }}-pgrx-pg${{ env.PG_VERSION }}-${{ env.PGRX_VERSION }} -${{ hashFiles('**/Cargo.lock ') }}
134136 restore-keys : |
135- ${{ runner.os }}-pgrx-pg16-0.14.3 -
136- ${{ runner.os }}-pgrx-pg16 -
137+ ${{ runner.os }}-pgrx-pg${{ env.PG_VERSION }}-${{ env.PGRX_VERSION }} -
138+ ${{ runner.os }}-pgrx-pg${{ env.PG_VERSION }} -
137139
138140 - name : Install system dependencies
139141 run : |
@@ -143,9 +145,9 @@ jobs:
143145 - name : Install and initialize pgrx
144146 run : |
145147 if [ ! -f ~/.cargo/bin/cargo-pgrx ]; then
146- cargo install cargo-pgrx --version=0.14.3 --locked
147- cargo pgrx init --pg16=download
148+ cargo install cargo-pgrx --version=${PGRX_VERSION} --locked
148149 fi
150+ cargo pgrx info pg-config ${PG_VERSION} >/dev/null 2>&1 || cargo pgrx init --pg${PG_VERSION}=download
149151
150152 - name : Run Rust tests
151- run : cargo test --features pg16
153+ run : cargo test --no-default-features -- features pg16
0 commit comments