Skip to content

Commit

Permalink
Merge pull request #8 from Glamhoth/glamhoth-refresh
Browse files Browse the repository at this point in the history
Project refresh
  • Loading branch information
Glamhoth authored Jun 25, 2024
2 parents 0b0ed36 + 604515c commit 3c52867
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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

38 changes: 11 additions & 27 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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"
7 changes: 7 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
comment:
layout: " diff, files"
behavior: default
require_changes: false
require_base: false
require_head: true
hide_project_coverage: false
1 change: 0 additions & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 3c52867

Please sign in to comment.