10
10
working-directory :pgml-extension
11
11
steps :
12
12
-uses :actions/checkout@v3
13
+ -name :Changed files in pgml-extension
14
+ id :pgml_extension_changed
15
+ run :|
16
+ echo "PGML_EXTENSION_CHANGED_FILES=$(git diff --name-only HEAD HEAD~1 . | wc -l)" >> $GITHUB_OUTPUT
13
17
-name :Install dependencies
18
+ if :steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
14
19
run :|
15
20
sudo apt-get update && \
16
21
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo apt-get install -y \
@@ -29,16 +34,19 @@ jobs:
29
34
sudo pip3 install -r requirements.txt
30
35
-name :Cache dependencies
31
36
uses :buildjet/cache@v3
37
+ if :steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
32
38
with :
33
39
path :|
34
40
~/.cargo
35
41
pgml-extension/target
36
42
~/.pgrx
37
43
key :${{ runner.os }}-rust-3-${{ hashFiles('pgml-extension/Cargo.lock') }}
38
44
-name :Submodules
45
+ if :steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
39
46
run :|
40
47
git submodule update --init --recursive
41
48
-name :Run tests
49
+ if :steps.pgml_extension_changed.outputs.PGML_EXTENSION_CHANGED_FILES != '0'
42
50
run :|
43
51
curl https://sh.rustup.rs -sSf | sh -s -- -y
44
52
source ~/.cargo/env