mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
CI: Move the clang toolchain CI to GitHub actions
This commit is contained in:
parent
c7828b0640
commit
ac8d5cce3c
Notes:
sideshowbarker
2024-07-17 17:40:13 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/ac8d5cce3c Pull-request: https://github.com/SerenityOS/serenity/pull/24263 Reviewed-by: https://github.com/ADKaster
43
.github/workflows/cmake.yml
vendored
43
.github/workflows/cmake.yml
vendored
@ -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'
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user