From 3d14a7d6a5ffbeee2b3ff0417be719bcb90007b9 Mon Sep 17 00:00:00 2001 From: QuentinCraft Date: Thu, 5 Dec 2024 20:42:02 +0000 Subject: [PATCH 1/4] feat: Enable caching system on Build workflow --- .github/workflows/build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1fea6c1..26566d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,18 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Cache .NET dependencies + uses: actions/cache@v3 + with: + path: | + ~/.nuget/packages + ~/.dotnet + **/bin + **/obj + key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-dotnet- + - name: Install SonarQube scanner shell: powershell run: | @@ -25,6 +37,14 @@ jobs: run: | dotnet tool install --global dotnet-coverage + - name: Cache SonarCloud data + uses: actions/cache@v3 + with: + path: .sonar + key: ${{ runner.os }}-sonar-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-sonar- + - name: Analyze with SonarQube env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} From b36c6aac3066f1ec661ccd02addc6f9645182d40 Mon Sep 17 00:00:00 2001 From: QuentinCraft Date: Thu, 5 Dec 2024 20:58:49 +0000 Subject: [PATCH 2/4] feat: Including .sonar folder in cache --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26566d0..e53f522 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,7 @@ jobs: ~/.dotnet **/bin **/obj + .sonar key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }} restore-keys: | ${{ runner.os }}-dotnet- From 32edacdc8109e5411f3cb1a525ba2194b4a0e712 Mon Sep 17 00:00:00 2001 From: QuentinCraft Date: Thu, 5 Dec 2024 21:08:05 +0000 Subject: [PATCH 3/4] fix: Remove .sonar from cache exclusions in build workflow --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e53f522..26566d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,6 @@ jobs: ~/.dotnet **/bin **/obj - .sonar key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }} restore-keys: | ${{ runner.os }}-dotnet- From 1b80d05270325388a6c8158ad7c36907d582c8f8 Mon Sep 17 00:00:00 2001 From: QuentinCraft Date: Thu, 5 Dec 2024 21:15:43 +0000 Subject: [PATCH 4/4] fix: Update cache paths for SonarCloud data in build workflow --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26566d0..485fcd4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,6 @@ jobs: path: | ~/.nuget/packages ~/.dotnet - **/bin - **/obj key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }} restore-keys: | ${{ runner.os }}-dotnet- @@ -40,7 +38,7 @@ jobs: - name: Cache SonarCloud data uses: actions/cache@v3 with: - path: .sonar + path: ~/.sonar key: ${{ runner.os }}-sonar-${{ hashFiles('**/*.csproj') }} restore-keys: | ${{ runner.os }}-sonar-