From 8baf12021da0b65f99a9336bdb2e0fc94f32e823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GREFFIER?= Date: Tue, 11 Feb 2025 23:47:19 +0100 Subject: [PATCH] Add Maven cache (#127) --- .github/workflows/pull_request.yml | 14 ++++++++++++++ .github/workflows/push_master.yml | 14 ++++++++++++++ .github/workflows/release.yml | 7 +++++++ 3 files changed, 35 insertions(+) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ad7a3fe..4f01832 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -23,6 +23,20 @@ jobs: distribution: 'temurin' cache: maven + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Check style run: mvn checkstyle:check diff --git a/.github/workflows/push_master.yml b/.github/workflows/push_master.yml index 1722b85..2bbf8d2 100644 --- a/.github/workflows/push_master.yml +++ b/.github/workflows/push_master.yml @@ -22,6 +22,20 @@ jobs: distribution: 'temurin' cache: maven + - name: Cache SonarQube packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Check style run: mvn checkstyle:check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6994522..2cbbdb5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,13 @@ jobs: distribution: 'temurin' cache: maven + - name: Cache Maven packages + uses: actions/cache@v4 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Package application run: mvn -B -DskipTests package -P production