From 2c18f3ec8cd3bf16a2a4652a985d6b1be061bd3b Mon Sep 17 00:00:00 2001 From: asavershin Date: Thu, 3 Oct 2024 01:17:02 +0300 Subject: [PATCH] 51 Try to caching maven dependencies --- .github/workflows/JavaMavenCI.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/JavaMavenCI.yml b/.github/workflows/JavaMavenCI.yml index 7c499da..814733d 100644 --- a/.github/workflows/JavaMavenCI.yml +++ b/.github/workflows/JavaMavenCI.yml @@ -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 @@ -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 @@ -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