Skip to content

Commit

Permalink
51 Try to caching maven dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
asavershin committed Oct 2, 2024
1 parent 20780e8 commit 2c18f3e
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/JavaMavenCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Checkstyle with maven
run: mvn checkstyle:check

Expand All @@ -34,7 +40,13 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Restore Maven cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Compile with maven
run: mvn clean compile

Expand All @@ -50,6 +62,12 @@ jobs:
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Restore Maven cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run tests with maven
run: mvn test

0 comments on commit 2c18f3e

Please sign in to comment.