diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4a7feaf..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' @@ -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/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 1b88315..cd5e2cd 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@v4 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/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 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