fix: limitsFloorView incorrect thing check when calculating visible f… #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Analysis - SonarCloud | |
on: | |
pull_request_target: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: | |
- main | |
env: | |
VCPKG_BUILD_TYPE: release | |
CMAKE_BUILD_PARALLEL_LEVEL: 2 | |
MAKEFLAGS: '-j 2' | |
NUMBER_OF_PROCESSORS: 2 | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@main | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} | |
with: | |
fetch-depth: 0 | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- uses: actions/checkout@main | |
if: ${{ github.event_name == 'push' }} | |
with: | |
fetch-depth: 0 | |
- name: Install Linux Dependencies | |
run: > | |
sudo apt-get update && sudo apt-get install ccache libglew-dev libx11-dev linux-headers-$(uname -r) | |
- name: Switch to gcc-11 | |
run: | | |
sudo apt install gcc-11 g++-11 | |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 | |
sudo update-alternatives --set gcc /usr/bin/gcc-11 | |
- name: CCache | |
id: ccache | |
uses: actions/cache@main | |
with: | |
path: $HOME/.ccache | |
key: ccache-${{ runner.os }}-${{ hashFiles('**/src') }} | |
restore-keys: | | |
ccache-${{ runner.os}}- | |
- name: Sonar cache | |
uses: actions/cache@main | |
with: | |
path: $HOME/.cfamily | |
key: sonar-${{ runner.os}}-${{ hashFiles('**/src') }} | |
restore-keys: | | |
sonar-${{ runner.os}}- | |
- name: Cache SonarCloud packages | |
uses: actions/cache@main | |
with: | |
path: $HOME/.sonar/cache | |
key: sonar-${{ runner.os}}-${{ hashFiles('**/src') }} | |
restore-keys: | | |
sonar-${{ runner.os}}- | |
- name: Restore artifacts and install vcpkg | |
id: vcpkg-step | |
run: | | |
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') | |
echo "vcpkg commit ID: $vcpkgCommitId" | |
echo "name=vcpkgGitCommitId::$vcpkgCommitId" >> $env:GITHUB_OUTPUT | |
- name: Get vcpkg commit id from vcpkg.json | |
uses: lukka/run-vcpkg@main | |
with: | |
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git" | |
vcpkgGitCommitId: ${{ steps.vcpkg-step.outputs.vcpkgGitCommitId }} | |
- name: Install sonar-scanner | |
uses: SonarSource/sonarcloud-github-c-cpp@v1 | |
- name: Generate compilation database | |
run: | | |
mkdir -p build | |
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DOPTIONS_ENABLE_CCACHE=ON -DSPEED_UP_BUILD_UNITY=OFF -S . -B build | |
- name: Run PR sonar-scanner | |
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
BRANCH: ${{ github.event.pull_request.head.ref }} | |
run: | | |
sonar-scanner \ | |
--define sonar.cfamily.threads="${{ env.NUMBER_OF_PROCESSORS }}" \ | |
--define sonar.cfamily.cache.enabled=true \ | |
--define sonar.cfamily.cache.path="$HOME/.cfamily" \ | |
--define sonar.cfamily.compile-commands=build/compile_commands.json \ | |
--define sonar.pullrequest.key=${{ github.event.pull_request.number }} \ | |
--define sonar.pullrequest.branch=$BRANCH \ | |
--define sonar.pullrequest.base=${{ github.event.pull_request.base_ref }} | |
- name: Run sonar-scanner | |
if: ${{ github.event_name == 'push' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
sonar-scanner \ | |
--define sonar.cfamily.threads="${{ env.NUMBER_OF_PROCESSORS }}" \ | |
--define sonar.cfamily.cache.enabled=true \ | |
--define sonar.cfamily.cache.path="$HOME/.cfamily" \ | |
--define sonar.cfamily.compile-commands=build/compile_commands.json |