14
14
required : false
15
15
os_list :
16
16
required : false
17
- default : ' ["ubuntu-latest", "windows-2019", "macOS-11 "]'
17
+ default : ' ["ubuntu-latest", "windows-2019", "macOS-13 "]'
18
18
python_version :
19
19
required : false
20
20
type : string
21
21
default : ' 3.11'
22
22
workflow_call :
23
23
inputs :
24
24
build_target :
25
- required : true
25
+ required : false
26
26
type : string
27
+ default : " all"
27
28
28
29
projects :
29
30
required : true
38
39
type : string
39
40
# Use windows-2019 due to:
40
41
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
41
- # We're using a specific version of macOS due to:
42
- # https://github.com/actions/virtual-environments/issues/5900
43
- default : ' ["ubuntu-latest", "windows-2019", "macOS-11"]'
42
+ default : ' ["ubuntu-latest", "windows-2019", "macOS-13"]'
44
43
45
44
python_version :
46
45
required : false
59
58
lit-tests :
60
59
name : Lit Tests
61
60
runs-on : ${{ matrix.os }}
61
+ container :
62
+ image : ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
63
+ volumes :
64
+ - /mnt/:/mnt/
62
65
strategy :
63
66
fail-fast : false
64
67
matrix :
78
81
with :
79
82
python-version : ${{ inputs.python_version }}
80
83
- name : Install Ninja
84
+ if : runner.os != 'Linux'
81
85
uses : llvm/actions/install-ninja@main
82
86
# actions/checkout deletes any existing files in the new git directory,
83
87
# so this needs to either run before ccache-action or it has to use
@@ -95,24 +99,51 @@ jobs:
95
99
# run creates a new cache entry so we want to ensure that we have
96
100
# enough cache space for all the tests to run at once and still
97
101
# fit under the 10 GB limit.
98
- max-size : 500M
102
+ # Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
103
+ max-size : 2G
99
104
key : ${{ matrix.os }}
100
105
variant : sccache
101
106
- name : Build and Test
102
- uses : llvm/actions/build-test-llvm-project@main
103
107
env :
104
108
# Workaround for https://github.com/actions/virtual-environments/issues/5900.
105
109
# This should be a no-op for non-mac OSes
106
110
PKG_CONFIG_PATH : /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
107
- with :
108
- cmake_args : ' -GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ inputs.extra_cmake_args }}'
109
- build_target : ' ${{ inputs.build_target }}'
111
+ shell : bash
112
+ id : build-llvm
113
+ run : |
114
+ if [ "${{ runner.os }}" == "Linux" ]; then
115
+ builddir="/mnt/build/"
116
+ mkdir -p $builddir
117
+ extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
118
+ else
119
+ builddir="$(pwd)"/build
120
+ fi
121
+ if [ "${{ runner.os }}" == "macOS" ]; then
122
+ # Workaround test failure on some lld tests on MacOS
123
+ # https://github.com/llvm/llvm-project/issues/81967
124
+ extra_cmake_args="-DLLVM_DISABLE_ASSEMBLY_FILES=ON"
125
+ fi
126
+ echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT"
127
+ cmake -G Ninja \
128
+ -B "$builddir" \
129
+ -S llvm \
130
+ -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" \
131
+ -DCMAKE_BUILD_TYPE=Release \
132
+ -DLLVM_ENABLE_ASSERTIONS=ON \
133
+ -DLLDB_INCLUDE_TESTS=OFF \
134
+ -DCMAKE_C_COMPILER_LAUNCHER=sccache \
135
+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
136
+ $extra_cmake_args \
137
+ ${{ inputs.extra_cmake_args }}
138
+ ninja -C "$builddir" '${{ inputs.build_target }}'
110
139
111
140
- name : Build and Test libclc
112
141
if : " !startsWith(matrix.os, 'windows') && contains(inputs.projects, 'libclc')"
142
+ env :
143
+ LLVM_BUILDDIR : ${{ steps.build-llvm.outputs.llvm-builddir }}
113
144
run : |
114
145
# Make sure all of LLVM libraries that llvm-config needs are built.
115
- ninja -C build
116
- 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"
146
+ ninja -C "$LLVM_BUILDDIR"
147
+ cmake -G Ninja -S libclc -B libclc-build -DLLVM_DIR="$LLVM_BUILDDIR" /lib/cmake/llvm -DLIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl"
117
148
ninja -C libclc-build
118
149
ninja -C libclc-build test
0 commit comments