From ac8d5cce3ca70838cbf01d0ff8be56eb368293f5 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 7 May 2024 15:17:19 -0400 Subject: [PATCH] CI: Move the clang toolchain CI to GitHub actions --- .github/workflows/cmake.yml | 43 ++++++++++++++++++++++++++----------- azure-pipelines.yml | 8 ------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 1af17ff8535..a190dfc1c7f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -21,15 +21,22 @@ jobs: strategy: fail-fast: false matrix: - debug-options: ['ALL_DEBUG', 'NORMAL_DEBUG'] + debug-options: ['NORMAL_DEBUG'] os: [ubuntu-22.04] - arch: ['x86_64', 'aarch64'] + arch: ['x86_64'] + toolchain: ['GNU', 'Clang'] # If ccache is broken and you would like to bust the ccache cache on Github Actions, increment this: ccache-mark: [0] - exclude: - # We currently manually disable the ALL_DEBUG build on AArch64 for sake of saving CI time, as it's not our main target. - - debug-options: 'ALL_DEBUG' + include: + - debug-options: 'NORMAL_DEBUG' + os: ubuntu-22.04 arch: 'aarch64' + toolchain: 'GNU' + + - debug-options: 'ALL_DEBUG' + os: ubuntu-22.04 + arch: 'x86_64' + toolchain: 'GNU' steps: # Pull requests can trail behind `master` and can cause breakage if merging before running the CI checks on an updated branch. @@ -60,17 +67,29 @@ jobs: with: os: 'Serenity' arch: ${{ matrix.arch }} - toolchain: 'GNU' + toolchain: ${{ matrix.toolchain }} cache_key_extra: ${{ matrix.debug-options }} serenity_ccache_path: ${{ env.SERENITY_CCACHE_DIR }} toolchain_ccache_path: ${{ env.TOOLCHAIN_CCACHE_DIR }} download_cache_path: ${{ github.workspace }}/Build/caches + - name: Assign Build Parameters + id: 'build-parameters' + run: | + if ${{ matrix.toolchain == 'Clang' }} ; then + echo "build_directory=${{ github.workspace }}/Build/${{ matrix.arch }}clang" >> "$GITHUB_OUTPUT" + elif ${{ matrix.toolchain == 'GNU' }} ; then + echo "build_directory=${{ github.workspace }}/Build/${{ matrix.arch }}" >> "$GITHUB_OUTPUT" + fi + - name: Build toolchain if: ${{ !steps.cache-restore.outputs.toolchain_prebuilt_hit }} - run: ARCH="${{ matrix.arch }}" ${{ github.workspace }}/Toolchain/BuildGNU.sh + run: | + ${{ github.workspace }}/Toolchain/Build${{ matrix.toolchain }}.sh --ci env: + ARCH: ${{ matrix.arch}} CCACHE_DIR: ${{ env.TOOLCHAIN_CCACHE_DIR }} + TRY_USE_LOCAL_TOOLCHAIN: 'y' - name: Build AArch64 Qemu if: ${{ matrix.arch == 'aarch64' && !steps.cache-restore.outputs.qemu_cache_hit }} @@ -84,7 +103,7 @@ jobs: run: | cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \ -DSERENITY_ARCH=${{ matrix.arch }} \ - -DSERENITY_TOOLCHAIN=GNU \ + -DSERENITY_TOOLCHAIN=${{ matrix.toolchain }} \ -DBUILD_LAGOM=ON \ -DCMAKE_C_COMPILER=gcc-13 \ -DCMAKE_CXX_COMPILER=g++-13 \ @@ -101,7 +120,7 @@ jobs: run: | cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \ -DSERENITY_ARCH=${{ matrix.arch }} \ - -DSERENITY_TOOLCHAIN=GNU \ + -DSERENITY_TOOLCHAIN=${{ matrix.toolchain }} \ -DCMAKE_C_COMPILER=gcc-13 \ -DCMAKE_CXX_COMPILER=g++-13 \ -DENABLE_UNDEFINED_SANITIZER=ON \ @@ -137,12 +156,12 @@ jobs: - name: Create Serenity Rootfs if: ${{ matrix.debug-options == 'NORMAL_DEBUG' }} - working-directory: ${{ github.workspace }}/Build/${{ matrix.arch }} + working-directory: ${{ steps.build-parameters.outputs.build_directory }} run: ninja install && ninja qemu-image - name: Run On-Target Tests if: ${{ matrix.debug-options == 'NORMAL_DEBUG' && matrix.arch != 'aarch64' }} - working-directory: ${{ github.workspace }}/Build/${{ matrix.arch }} + working-directory: ${{ steps.build-parameters.outputs.build_directory }} env: SERENITY_QEMU_CPU: "max,vmx=off" SERENITY_KERNEL_CMDLINE: "graphics_subsystem_mode=off panic=shutdown system_mode=self-test" @@ -167,5 +186,5 @@ jobs: - name: Print Target Logs # Extremely useful if Serenity hangs trying to run one of the tests if: ${{ !cancelled() && matrix.debug-options == 'NORMAL_DEBUG'}} - working-directory: ${{ github.workspace }}/Build/${{ matrix.arch }} + working-directory: ${{ steps.build-parameters.outputs.build_directory }} run: '[ ! -e debug.log ] || cat debug.log' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0005a87a3e4..f8e36921a88 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,11 +28,3 @@ stages: os: 'macOS' host_cc: '$(brew --prefix llvm@18)/bin/clang' host_cxx: '$(brew --prefix llvm@18)/bin/clang++' - - - stage: SerenityOS - dependsOn: [] - - jobs: - - template: Meta/Azure/Serenity.yml - parameters: - arch: 'x86_64'