1 name: LLVM Project Tests
24 # Skip intermediate builds: always.
25 # Cancel intermediate builds: only if it is a pull request build.
26 # If the group name here is the same as the group name in the workflow that includes
27 # this one, then the action will try to wait on itself and get stuck.
28 group: llvm-project-${{ github.workflow }}-${{ inputs.projects }}${{ github.ref }}
29 cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
34 runs-on: ${{ matrix.os }}
40 # Use windows-2019 due to:
41 # https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
43 # We're using a specific version of macOS due to:
44 # https://github.com/actions/virtual-environments/issues/5900
48 if: startsWith(matrix.os, 'windows')
49 uses: llvm/actions/setup-windows@main
52 # On Windows, starting with win19/20220814.1, cmake choose the 32-bit
53 # python3.10.6 libraries instead of the 64-bit libraries when building
54 # lldb. Using this setup-python action to make 3.10 the default
57 uses: actions/setup-python@v4
59 python-version: '3.11'
61 uses: llvm/actions/install-ninja@main
62 # actions/checkout deletes any existing files in the new git directory,
63 # so this needs to either run before ccache-action or it has to use
65 - uses: actions/checkout@v4
69 uses: hendrikmuhs/ccache-action@v1
71 # A full build of llvm, clang, lld, and lldb takes about 250MB
72 # of ccache space. There's not much reason to have more than this,
73 # because we usually won't need to save cache entries from older
74 # builds. Also, there is an overall 10GB cache limit, and each
75 # run creates a new cache entry so we want to ensure that we have
76 # enough cache space for all the tests to run at once and still
77 # fit under the 10 GB limit.
79 key: sccache-${{ matrix.os }}
81 - name: Build and Test
82 uses: llvm/actions/build-test-llvm-project@main
84 # Workaround for https://github.com/actions/virtual-environments/issues/5900.
85 # This should be a no-op for non-mac OSes
86 PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
88 cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache'
89 build_target: '${{ inputs.build_target }}'
91 - name: Build and Test libclc
92 if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')"
94 # Make sure all of LLVM libraries that llvm-config needs are built.
96 cmake -G Ninja -S libclc -B libclc-build -DLLVM_DIR="$(pwd)"/build/lib/cmake/llvm -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
98 ninja -C libclc-build test