|
| 1 | +# This workflow is for pre-commit testing of the LLVM-libc project. |
| 2 | +name: LLVM-libc Pre-commit Fullbuild Tests |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: [ "main" ] |
| 7 | + paths: |
| 8 | + - 'libc/**' |
| 9 | + - '.github/workflows/libc-fullbuild-tests.yml' |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + env: |
| 14 | + SCCACHE_GHA_ENABLED: "true" |
| 15 | + runs-on: ubuntu-24.04 |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - c_compiler: clang |
| 21 | + cpp_compiler: clang++ |
| 22 | + - c_compiler: gcc |
| 23 | + cpp_compiler: g++ |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + |
| 27 | + - name: Run sccache-cache |
| 28 | + uses: mozilla-actions/[email protected] |
| 29 | + |
| 30 | + - name: Prepare dependencies (Ubuntu) |
| 31 | + run: | |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build |
| 34 | +
|
| 35 | + - name: Set reusable strings |
| 36 | + id: strings |
| 37 | + shell: bash |
| 38 | + run: | |
| 39 | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" |
| 40 | + echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT" |
| 41 | +
|
| 42 | + - name: Configure CMake |
| 43 | + run: > |
| 44 | + cmake -B ${{ steps.strings.outputs.build-output-dir }} |
| 45 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 46 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 47 | + -DCMAKE_BUILD_TYPE=RelWithDebInfo |
| 48 | + -DCMAKE_C_COMPILER_LAUNCHER=sccache |
| 49 | + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache |
| 50 | + -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} |
| 51 | + -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt" |
| 52 | + -DLLVM_LIBC_FULL_BUILD=ON |
| 53 | + -DLLVM_LIBC_INCLUDE_SCUDO=ON |
| 54 | + -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON |
| 55 | + -DCOMPILER_RT_BUILD_GWP_ASAN=OFF |
| 56 | + -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF |
| 57 | + -S ${{ github.workspace }}/runtimes |
| 58 | +
|
| 59 | + - name: Build |
| 60 | + run: > |
| 61 | + cmake |
| 62 | + --build ${{ steps.strings.outputs.build-output-dir }} |
| 63 | + --parallel |
| 64 | + --target install |
| 65 | +
|
| 66 | + - name: Test |
| 67 | + run: > |
| 68 | + cmake |
| 69 | + --build ${{ steps.strings.outputs.build-output-dir }} |
| 70 | + --parallel |
| 71 | + --target check-libc |
0 commit comments