CI+Meta: Update Sonar Cloud CI job for new SuperBuild configuration

This requires exposing the `configure` step on the `serenity`
ExternalProject in the SuperBuild CMakeLists so that we can continue to
only build the generated sources and not the entire OS.
This commit is contained in:
Andrew Kaster 2021-09-16 01:56:54 -06:00 committed by Brian Gianforcaro
parent a78f967b93
commit 454a839f49
2 changed files with 20 additions and 10 deletions

View file

@ -42,7 +42,7 @@ jobs:
echo "sonar.organization=serenityos" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.cfamily.cache.enabled=true" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.cfamily.cache.path=.sonar" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.cfamily.compile-commands=${{ github.workspace }}/Build/compile_commands.json" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.cfamily.compile-commands=${{ github.workspace }}/Build/${{ env.SONAR_ANALYSIS_ARCH }}/compile_commands.json" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.cfamily.threads=2" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.host.url=${{ env.SONAR_SERVER_URL }}" >> ${{ github.workspace }}/sonar-project.properties
echo "sonar.sources=AK,Build,Userland,Kernel,Meta" >> ${{ github.workspace }}/sonar-project.properties
@ -98,19 +98,29 @@ jobs:
- name: Create build directory
run: |
mkdir -p ${{ github.workspace }}/Build
mkdir -p ${{ github.workspace }}/Build/UCD
mkdir -p ${{ github.workspace }}/Build/CLDR
mkdir -p ${{ github.workspace }}/Build/${{ env.SONAR_ANALYSIS_ARCH }}/UCD
mkdir -p ${{ github.workspace }}/Build/${{ env.SONAR_ANALYSIS_ARCH }}/CLDR
- name: Create build environment
working-directory: ${{ github.workspace }}/Build
run: cmake .. -GNinja -DSERENITY_ARCH=i686 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_PCI_IDS_DOWNLOAD=OFF -DENABLE_USB_IDS_DOWNLOAD=OFF -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
working-directory: ${{ github.workspace }}
run: |
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
-DSERENITY_ARCH=${{ env.SONAR_ANALYSIS_ARCH }} \
-DSERENITY_TOOLCHAIN=GNU \
-DCMAKE_C_COMPILER=gcc-10 \
-DCMAKE_CXX_COMPILER=g++-10 \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF
- name: Build generated sources so they are available for analysis.
working-directory: ${{ github.workspace }}/Build
working-directory: ${{ github.workspace }}
# Note: The superbuild will create the Build/arch directory when doing the
# configure step for the serenity ExternalProject, as that's the configured
# binary directory for that project.
run: |
ninja all_generated
ninja -C Build/superbuild serenity-configure
cmake -B Build/{{ env.SONAR_ANALYSIS_ARCH }} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
ninja -C Build/{{ env.SONAR_ANALYSIS_ARCH }} all_generated
- name: Run sonar-scanner, upload results
env:

View file

@ -130,7 +130,7 @@ ExternalProject_Add(
BUILD_ALWAYS YES
# Host tools must be built and installed before the OS can be built
DEPENDS lagom-install
STEP_TARGETS install
STEP_TARGETS configure install
${console_access}
)