Skip to content

Commit

Permalink
♻️ [CI] Aligned chaching of dependencies for Sonar Scan workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Codutti <[email protected]>
  • Loading branch information
Coduz committed Jan 23, 2025
1 parent 48e771b commit 486d70d
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/sonarCloud-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- 'develop'
- 'release-**'
- 'feat-improvedGitHubActionCaching'
pull_request:
branches:
- 'develop'
Expand All @@ -14,33 +15,39 @@ jobs:
build:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
- name: Clones Kapua repo inside the runner
uses: actions/checkout@v4

- name: Setup Java 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- name: Set up Node 16
uses: actions/setup-node@v4
java-version: 11

- name: Setup Node 16
uses: actions/setup-node@v4 # Installs Node and NPM
with:
node-version: 16

- name: Install Swagger CLI # Installs Swagger CLI to bundle OpenAPI files
run: 'npm install -g @apidevtools/swagger-cli'
shell: bash

- name: Cache Maven repository - External dependencies # Cache of external Maven dependencies to speed up build time
id: cache-maven-external-deps
uses: actions/cache@v4
with:
path: ~/.m2/repository/
key: ${{ runner.os }}-maven-develop-dependencies

- 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/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 486d70d

Please sign in to comment.