1 name: LLVM Project Tests
21 # Skip intermediate builds: always.
22 # Cancel intermediate builds: only if it is a pull request build.
23 # If the group name here is the same as the group name in the workflow that includes
24 # this one, then the action will try to wait on itself and get stuck.
25 group: llvm-project-${{ github.workflow }}-${{ inputs.projects}}${{ github.ref }}
26 cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
31 runs-on: ${{ matrix.os }}
37 # Use windows-2019 due to:
38 # https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
40 # We're using a specific version of macOS due to:
41 # https://github.com/actions/virtual-environments/issues/5900
45 if: startsWith(matrix.os, 'windows')
46 uses: llvm/actions/setup-windows@main
50 uses: llvm/actions/install-ninja@main
51 # actions/checkout deletes any existing files in the new git directory,
52 # so this needs to either run before ccache-action or it has to use
54 - uses: actions/checkout@v3
58 uses: hendrikmuhs/ccache-action@v1.2
60 # A full build of llvm, clang, lld, and lldb takes about 250MB
61 # of ccache space. There's not much reason to have more than this,
62 # because we usually won't need to save cache entries from older
63 # builds. Also, there is an overall 10GB cache limit, and each
64 # run creates a new cache entry so we want to ensure that we have
65 # enough cache space for all the tests to run at once and still
66 # fit under the 10 GB limit.
68 key: sccache-${{ matrix.os }}
70 - name: Build and Test
71 uses: llvm/actions/build-test-llvm-project@main
73 # Workaround for https://github.com/actions/virtual-environments/issues/5900.
74 # This should be a no-op for non-mac OSes
75 PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
77 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'
78 build_target: '${{ inputs.build_target }}'
80 - name: Build and Test libclc
81 if: "!startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')"
83 # Make sure all of LLVM libraries that llvm-config needs are built.
85 cmake -G Ninja -S libclc -B libclc-build -DLLVM_CONFIG=`pwd`/build/bin/llvm-config -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
87 ninja -C libclc-build test