Skip to content

Commit a9d9473

Browse files
committed
OWASP OWASP#714 : Adding cache restoring job in java_swagger_doc workflow file
1 parent fe76a18 commit a9d9473

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/dast-zap-test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ jobs:
2626
id: cache-jar
2727
uses: actions/cache@v3
2828
with:
29-
path: target/wrongsecrets-1.7.0-SNAPSHOT.jar
29+
path: ./target/wrongsecrets-1.7.0-SNAPSHOT.jar
3030
key: JarCache-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
3131
restore-keys: |
3232
JarCache-${{ runner.os }}-
33-
- name: test
34-
run: |
35-
cd target
36-
ls
3733
- name: Start wrongsecrets
3834
run: nohup ./mvnw spring-boot:run -Dspring-boot.run.profiles=without-vault &
3935
- name: ZAP Scan

.github/workflows/java_swagger_doc.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,25 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17+
- name: Check the cache
18+
uses: actions/cache/restore@v3
19+
id: cache
20+
with:
21+
path: ./target
22+
key: JarCache-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
23+
- name: Check cache hit
24+
id: cache-hit-check
25+
run: echo "::set-output name=cache-hit::${{ steps.cache.outputs.cache-hit }}"
1726
- name: Set up JDK 21
27+
if: steps.cache.outputs.cache-hit != 'true'
1828
uses: actions/setup-java@v3
1929
with:
2030
java-version: "21"
2131
distribution: "corretto"
2232
- name: Clean install
33+
if: steps.cache.outputs.cache-hit != 'true'
2334
run: ./mvnw --no-transfer-progress clean install -DskipTests -Ddependency-check.skip -Dcyclonedx.skip=true -Dexec.skip
35+
2436
- name: Compile javadoc
2537
run: ./mvnw --no-transfer-progress compile javadoc:javadoc
2638
- name: Start wrongsecrets

0 commit comments

Comments
 (0)