From 53aaa9dc43228f0a6aac5e7c2985a109812f708c Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Sun, 19 Dec 2021 03:03:32 +0100 Subject: [PATCH] Enable sonar cache --- .github/workflows/main.yml | 9 ++++++++- sonar-project.properties | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88e1316..9a79ed6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,6 +15,7 @@ jobs: SONAR_SCANNER_VERSION: 4.4.0.2170 SONAR_SERVER_URL: "https://sonarcloud.io" BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed + SONAR_CACHE_DIR: sonar_cache environment: deploy strategy: fail-fast: false @@ -80,12 +81,18 @@ jobs: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} idf.py --ccache build ccache -s + - name: Cache sonar + uses: 0xFEEDC0DE64/cache-with-update@update-cache-on-cachehit + with: + path: ${{ env.SONAR_SERVER_URL }} + key: ${{ runner.os }}-sonar-${{ matrix.node }} + - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" + sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.cache.path="${{ env.SONAR_CACHE_DIR }}" - name: Set outputs id: vars diff --git a/sonar-project.properties b/sonar-project.properties index f79fba2..3dac7cb 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -12,3 +12,5 @@ sonar.organization=bobbycar-graz #sonar.sourceEncoding=UTF-8 sonar.cfamily.threads=2 + +sonar.cfamily.cache.enabled=true