|
| 1 | +# This workflow is for pre-commit testing of the LLVM-libc project. |
| 2 | +name: LLVM-libc Pre-commit Overlay Tests |
| 3 | + |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + branches: [ "main" ] |
| 7 | + paths: |
| 8 | + - 'libc/**' |
| 9 | + - '.github/workflows/libc-overlay-tests.yml' |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + env: |
| 14 | + SCCACHE_GHA_ENABLED: "true" |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. |
| 18 | + fail-fast: false |
| 19 | + matrix: |
| 20 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 21 | + build_type: [Release, Debug] |
| 22 | + compiler: [ |
| 23 | + { c_compiler: gcc, cpp_compiler: g++ }, |
| 24 | + { c_compiler: clang, cpp_compiler: clang++ }, |
| 25 | + { c_compiler: clang-cl, cpp_compiler: clang-cl } |
| 26 | + ] |
| 27 | + exclude: |
| 28 | + - os: windows-latest |
| 29 | + compiler: { c_compiler: gcc, cpp_compiler: g++ } |
| 30 | + - os: ubuntu-latest |
| 31 | + compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl } |
| 32 | + - os: macos-latest |
| 33 | + compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl } |
| 34 | + - os: macos-latest |
| 35 | + compiler: { c_compiler: gcc, cpp_compiler: g++ } |
| 36 | + |
| 37 | + steps: |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Run sccache-cache |
| 41 | + uses: mozilla-actions/[email protected] |
| 42 | + |
| 43 | + - name: Set reusable strings |
| 44 | + id: strings |
| 45 | + shell: bash |
| 46 | + run: | |
| 47 | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" |
| 48 | +
|
| 49 | + - name: Configure CMake |
| 50 | + run: > |
| 51 | + cmake -B ${{ steps.strings.outputs.build-output-dir }} |
| 52 | + -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }} |
| 53 | + -DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }} |
| 54 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 55 | + -DCMAKE_C_COMPILER_LAUNCHER=sccache |
| 56 | + -DCMAKE_CXX_COMPILER_LAUNCHER=sccache |
| 57 | + -DLLVM_ENABLE_RUNTIMES=libc |
| 58 | + -G Ninja |
| 59 | + -S ${{ github.workspace }}/runtimes |
| 60 | +
|
| 61 | + - name: Build |
| 62 | + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} |
| 63 | + |
| 64 | + - name: Test |
| 65 | + working-directory: ${{ steps.strings.outputs.build-output-dir }} |
| 66 | + run: ninja check-libc |
0 commit comments