1414 required : true
1515 type : boolean
1616 default : false
17+ use-cache :
18+ description : ' If cache should be used'
19+ required : true
20+ type : boolean
21+ default : true
1722 workflow_call :
1823 inputs :
1924 run-integration-tests :
2025 description : ' If integration test should be run'
2126 required : true
2227 type : boolean
2328 default : false
29+ use-cache :
30+ description : ' If cache should be used'
31+ required : true
32+ type : boolean
33+ default : false
2434env :
2535 GSK_DISABLE_ANALYTICS : true
2636defaults :
@@ -77,10 +87,12 @@ jobs:
7787 - name : Setup Gradle # To cache ~/.gradle
7888 uses : gradle/gradle-build-action@v2
7989 with :
90+ cache-disabled : ${{ github.event_name != 'pull_request' && !inputs.use-cache }}
8091 cache-read-only : false
8192
8293 - name : Cache SonarQube packages
8394 uses : actions/cache@v3
95+ if : ${{ github.event_name == 'pull_request' || inputs.use-cache }}
8496 with :
8597 path : ~/.sonar/cache
8698 key : ${{ runner.os }}-sonar
@@ -112,10 +124,12 @@ jobs:
112124 - name : Setup Gradle # To cache ~/.gradle
113125 uses : gradle/gradle-build-action@v2
114126 with :
127+ cache-disabled : ${{ github.event_name != 'pull_request' && !inputs.use-cache }}
115128 cache-read-only : false
116129
117130 - name : Cache Frontend dependencies
118131 uses : actions/cache@v3
132+ if : ${{ github.event_name == 'pull_request' || inputs.use-cache }}
119133 with :
120134 path : frontend/node_modules
121135 key : ${{ runner.os }}-frontend-${{ hashFiles('frontend/package-lock.json')}}
@@ -168,6 +182,7 @@ jobs:
168182
169183 - name : Cache Python deps
170184 uses : actions/cache@v3
185+ if : ${{ github.event_name == 'pull_request' || inputs.use-cache }}
171186 with :
172187 path : python-client/.venv
173188 key : ${{ matrix.os }}-${{ matrix.python-version }}-python-deps-${{ hashFiles('python-client/tests/fixtures/**/*py')}}
@@ -186,6 +201,7 @@ jobs:
186201
187202 - name : Cache Giskard test resources
188203 uses : actions/cache@v3
204+ if : ${{ github.event_name == 'pull_request' || inputs.use-cache }}
189205 with :
190206 path : ~/.giskard
191207 key : ${{ matrix.os }}-${{ matrix.python-version }}-python-test-resources-${{ hashFiles('python-client/tests/fixtures/**/*py')}}
0 commit comments