|
1 | 1 | # This workflow is for pre-commit testing of the LLVM-libc project.
|
2 | 2 | name: LLVM-libc Pre-commit Overlay Tests
|
3 |
| - |
| 3 | +permissions: |
| 4 | + contents: read |
4 | 5 | on:
|
5 | 6 | pull_request:
|
6 | 7 | branches: [ "main" ]
|
@@ -32,20 +33,30 @@ jobs:
|
32 | 33 |
|
33 | 34 | steps:
|
34 | 35 | - uses: actions/checkout@v4
|
35 |
| - |
| 36 | + |
| 37 | + # Libc's build is relatively small comparing with other components of LLVM. |
| 38 | + # A fresh linux overlay takes about 180MiB of uncompressed disk space, which can |
| 39 | + # be compressed into ~40MiB. MacOS and Windows overlay builds are less than 10MiB |
| 40 | + # after compression. Limiting the cache size to 1G should be enough. |
| 41 | + # Prefer sccache as it is modern and it has a guarantee to work with MSVC. |
| 42 | + # Do not use direct GHAC access even though it is supported by sccache. GHAC rejects |
| 43 | + # frequent small object writes. |
36 | 44 | - name: Setup ccache
|
37 | 45 | uses: hendrikmuhs/ccache-action@v1
|
38 | 46 | with:
|
39 | 47 | max-size: 1G
|
40 | 48 | key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
|
41 | 49 | variant: sccache
|
42 | 50 |
|
| 51 | + # MPFR is required by some of the mathlib tests. |
43 | 52 | - name: Prepare dependencies (Ubuntu)
|
44 | 53 | if: runner.os == 'Linux'
|
45 | 54 | run: |
|
46 | 55 | sudo apt-get update
|
47 | 56 | sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build
|
48 | 57 |
|
| 58 | + # Chocolatey is shipped with Windows runners. Windows Server 2025 recommends WinGet. |
| 59 | + # Consider migrating to WinGet when Windows Server 2025 is available. |
49 | 60 | - name: Prepare dependencies (Windows)
|
50 | 61 | if: runner.os == 'Windows'
|
51 | 62 | run: |
|
|
62 | 73 | run: |
|
63 | 74 | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
64 | 75 |
|
| 76 | + # Use MinSizeRel to reduce the size of the build. |
| 77 | + # Notice that CMP0141=NEW and MSVC_DEBUG_INFORMATION_FORMAT=Embedded are required |
| 78 | + # by the sccache tool. |
65 | 79 | - name: Configure CMake
|
66 | 80 | run: >
|
67 | 81 | cmake -B ${{ steps.strings.outputs.build-output-dir }}
|
|
0 commit comments