From fd1424d3a8aef93ca299ecf0d3029a37cac79afb Mon Sep 17 00:00:00 2001 From: Filip Demski Date: Tue, 18 Jun 2024 15:52:45 +0200 Subject: [PATCH 1/3] Git: Updated SonarCloud GitHub Actions --- .github/workflows/sonarcloud.yml | 38 +++++++++----------------------- sonar-project.properties | 1 - 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1b88315..0c999d8 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -7,36 +7,17 @@ on: jobs: analysis: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: - SONAR_SCANNER_VERSION: 4.6.1.2450 - SONAR_SERVER_URL: "https://sonarcloud.io" + BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: 'recursive' fetch-depth: 0 - - name: "Set up JDK 11" - uses: actions/setup-java@v1 - with: - java-version: 11 - - - name: "Download and set up sonar-scanner" - env: - SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip - run: | - mkdir -p $HOME/.sonar - curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH - - - name: "Configure sonar-scanner" - working-directory: ${{ github.workspace }} - run: | - echo "sonar.projectVersion=${{ github.sha }}" >> sonar-project.properties - echo "sonar.cfamily.compile-commands=${{ github.workspace }}/build/compile_commands.json" >> sonar-project.properties - echo "sonar.host.url=${{ env.SONAR_SERVER_URL }}" >> sonar-project.properties + - name: "Install sonar-scanner and build-wrapper" + uses: SonarSource/sonarcloud-github-c-cpp@v2 - name: "Configure build" working-directory: ${{ github.workspace }} @@ -47,13 +28,16 @@ jobs: -D TACHYON_TOOLS_ENABLE_FORMATTING=OFF \ -D TACHYON_TOOLS_ENABLE_TAGS=OFF - - name: "Build" + - name: "Run build-wrapper" working-directory: ${{ github.workspace }}/build - run: cmake --build . + run: | + build-wrapper-linux-x86-64 --out-dir ${{ github.workspace }}/${{ env.BUILD_WRAPPER_OUT_DIR }} \ + cmake --build . - name: "Run sonar-scanner and upload the results" working-directory: ${{ github.workspace }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: sonar-scanner + run: | + sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" diff --git a/sonar-project.properties b/sonar-project.properties index 3d1638e..c1aae75 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,7 +1,6 @@ sonar.projectName=repo-template sonar.projectKey=tachyon-computer_repo-template sonar.organization=tachyon-computer -sonar.cfamily.cache.enabled=false sonar.cfamily.threads=2 sonar.sources=src sonar.tests=tests From 5c8cbc8e778fb37896ebe798e1dc020dfd919bf1 Mon Sep 17 00:00:00 2001 From: Filip Demski Date: Tue, 25 Jun 2024 12:19:27 +0200 Subject: [PATCH 2/3] Git: Update CodeCov GitHub Actions --- .github/workflows/build_and_test.yml | 8 ++++++-- codecov.yaml | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 codecov.yaml diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4a7feaf..679f74f 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -64,7 +64,11 @@ jobs: lcov --remove coverage.info '/usr/*' "$GITHUB_WORKSPACE"'/extern/*' --output-file coverage.info lcov --list coverage.info - - uses: codecov/codecov-action@v2 + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: - files: ./build/coverage.info fail_ci_if_error: true + files: ./build/coverage.info + name: repo-template + diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 0000000..808cefe --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,7 @@ +comment: + layout: " diff, files" + behavior: default + require_changes: false + require_base: false + require_head: true + hide_project_coverage: false From 604515ca1b4e804953f7f70da077717344510bda Mon Sep 17 00:00:00 2001 From: Filip Demski Date: Tue, 25 Jun 2024 18:03:36 +0200 Subject: [PATCH 3/3] Git: Updated `checkout` to v4 --- .github/workflows/build_and_test.yml | 2 +- .github/workflows/sonarcloud.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 679f74f..825e26e 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -16,7 +16,7 @@ jobs: build_and_test: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 0c999d8..cd5e2cd 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -11,7 +11,7 @@ jobs: env: BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' fetch-depth: 0