@@ -14,6 +14,10 @@ inputs:
14
14
restore-key :
15
15
required : true
16
16
description : ' '
17
+ python-version :
18
+ required : false
19
+ description : ' '
20
+ default : ' 3.12'
17
21
18
22
outputs :
19
23
cache-dir :
45
49
id : canonicalize-cache-dir
46
50
shell : bash
47
51
run : |
48
- if [[ "${{ inputs.os }}" == "almalinux" ]]; then
52
+ if [[ "${{ inputs.os }}" == "almalinux" ]] || [[ "${{ inputs.os }}" == "ubuntu" ]] ; then
49
53
echo "cache-dir=/tmp/.container-cache" >> $GITHUB_OUTPUT
50
54
elif [[ "${{ inputs.os }}" == "macos" ]]; then
51
55
echo "cache-dir=/tmp/.container-cache" >> $GITHUB_OUTPUT
@@ -81,18 +85,18 @@ runs:
81
85
82
86
- name : " Install Python"
83
87
uses : actions/setup-python@v4
84
- if : ${{ startsWith(inputs.os, 'macos') || startsWith(inputs.os, 'windows') }}
88
+ if : ${{ startsWith(inputs.os, 'macos') || startsWith(inputs.os, 'windows') || startsWith(inputs.os, 'ubuntu') }}
85
89
with :
86
- python-version : ' 3.12 '
90
+ python-version : ${{ inputs.python-version }}
87
91
88
92
- name : " Setup compiler/toolchain"
89
93
uses : aminya/setup-cpp@v1
90
- if : ${{ startsWith(inputs.os, 'almalinux') || startsWith(inputs.os, 'windows') }}
94
+ if : ${{ startsWith(inputs.os, 'almalinux') || startsWith(inputs.os, 'ubuntu') || startsWith(inputs.os, ' windows') }}
91
95
with :
92
96
compiler : llvm-18
93
97
cmake : true
94
98
ninja : true
95
- ccache : ${{ startsWith(inputs.os, 'windows') }}
99
+ ccache : ${{ startsWith(inputs.os, 'windows') || startsWith(inputs.os, 'ubuntu') }}
96
100
vcvarsall : ${{ startsWith(inputs.os, 'windows') }}
97
101
98
102
- name : " Set CC/CXX"
@@ -101,6 +105,9 @@ runs:
101
105
if [[ "${{ inputs.os }}" == "almalinux" ]]; then
102
106
echo "CC=/github/home/llvm/bin/clang" >> $GITHUB_ENV
103
107
echo "CXX=/github/home/llvm/bin/clang++" >> $GITHUB_ENV
108
+ elif [[ "${{ inputs.os }}" == "ubuntu" ]]; then
109
+ echo "CC=/usr/lib/llvm-18/bin/clang" >> $GITHUB_ENV
110
+ echo "CXX=/usr/lib/llvm-18/bin/clang++" >> $GITHUB_ENV
104
111
elif [[ "${{ inputs.os }}" == "windows" ]]; then
105
112
echo "CC=/C/Users/runneradmin/llvm/bin/clang-cl.exe" >> $GITHUB_ENV
106
113
echo "CXX=/C/Users/runneradmin/llvm/bin/clang-cl.exe" >> $GITHUB_ENV
@@ -113,8 +120,8 @@ runs:
113
120
shell : bash
114
121
run : |
115
122
python3_command=""
116
- if (command -v python3.12 &> /dev/null); then
117
- python3_command="python3.12 "
123
+ if (command -v python${{ inputs.python-version }} &> /dev/null); then
124
+ python3_command="python${{ inputs.python-version }} "
118
125
elif (command -v python3 &> /dev/null); then
119
126
python3_command="python3"
120
127
elif (command -v python &> /dev/null); then
@@ -139,6 +146,7 @@ runs:
139
146
echo "CCACHE_CPP2=true" >> $GITHUB_ENV
140
147
echo "CCACHE_UMASK=002" >> $GITHUB_ENV
141
148
149
+ echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
142
150
echo "CMAKE_C_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
143
151
echo "CMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
144
152
echo "Python3_EXECUTABLE=$(which $python3_command)" >> $GITHUB_ENV
0 commit comments