-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathp19_cachingMavenDependenciesManually.yaml
More file actions
39 lines (31 loc) · 1.1 KB
/
Copy pathp19_cachingMavenDependenciesManually.yaml
File metadata and controls
39 lines (31 loc) · 1.1 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
name: Maven Cache Check with manual caching
on:
workflow_dispatch:
jobs:
cache-test:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout Code
uses: actions/checkout@v4
- name: Step 2 - Cache Maven dependencies
id: maven-cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: Step 4 - Show Cache Status
run: |
if [[ "${{ steps.maven-cache.outputs.cache-hit }}" == 'true' ]]; then
echo "✅ Cache HIT: Maven dependencies are reused."
else
echo "⚠️ Cache MISS: Dependencies not cached, will download fresh."
fi
- name: Step 4 - Setup Java (optional for Maven later)
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Step 5 - Run a dummy Maven goal (skip tests) to fetch all the dependencies
run: mvn dependency:go-offline -B
- name: Step 5 - Done
run: echo "📦 Dependency download completed"