feat: add complement 'beds' option for houses. #66
Workflow file for this run
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: debug | |
CMAKE_BUILD_PARALLEL_LEVEL: 2 | |
MAKEFLAGS: '-j 2' | |
VCPKG_BINARY_SOURCES: clear;default,readwrite | |
jobs: | |
sonarcloud: | |
name: SonarCloud | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
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@v3 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
fetch-depth: 0 | |
- name: Install Linux Dependencies | |
run: > | |
sudo apt-get update && sudo apt-get install ccache 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: 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 "::set-output name=vcpkgGitCommitId::$vcpkgCommitId" | |
- 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 additional libraries | |
run: sudo apt-get install libasio-dev nlohmann-json3-dev libfmt-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev libglib2.0-dev at-spi2-core libwxgtk3.0-gtk3-dev libarchive-dev freeglut3-dev libxmu-dev libdbus-1-dev libxtst-dev | |
- 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 -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 }} | |
run: | | |
sonar-scanner \ | |
--define sonar.cfamily.compile-commands=build/compile_commands.json \ | |
--define sonar.pullrequest.key=${{ github.event.pull_request.number }} \ | |
--define sonar.pullrequest.branch=${{ github.event.pull_request.head.ref }} \ | |
--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.compile-commands=build/compile_commands.json |