5353 FAST_JIT_BUILD_OPTIONS : " -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=1 -DWAMR_BUILD_FAST_JIT=1 -DWAMR_BUILD_JIT=0 -DWAMR_BUILD_LAZY_JIT=1"
5454 LLVM_LAZY_JIT_BUILD_OPTIONS : " -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=1"
5555 LLVM_EAGER_JIT_BUILD_OPTIONS : " -DWAMR_BUILD_AOT=1 -DWAMR_BUILD_FAST_INTERP=0 -DWAMR_BUILD_INTERP=0 -DWAMR_BUILD_JIT=1 -DWAMR_BUILD_LAZY_JIT=0"
56+ TARGET_OS : " ubuntu-22.04"
5657
5758permissions :
5859 contents : read
6465 actions : write
6566 uses : ./.github/workflows/build_llvm_libraries.yml
6667 with :
67- os : " ubuntu-20.04 "
68+ os : $TARGET_OS
6869 arch : " X86"
6970
7071 build_iwasm :
@@ -102,26 +103,18 @@ jobs:
102103 " -DWAMR_DISABLE_HW_BOUND_CHECK=1" ,
103104 " -DWAMR_BUILD_SGX_IPFS=1" ,
104105 ]
105- os : [ubuntu-20.04 ]
106- platform : [linux-sgx]
106+ os : [ $TARGET_OS ]
107+ platform : [ linux-sgx ]
107108 exclude :
108109 # incompatible mode and feature
109110 # MINI_LOADER only on INTERP mode
110111 - make_options_run_mode : $AOT_BUILD_OPTIONS
111112 make_options_feature : " -DWAMR_BUILD_MINI_LOADER=1"
112113 steps :
113114 - name : install SGX SDK and necessary libraries
114- run : |
115- mkdir -p /opt/intel
116- cd /opt/intel
117- wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
118- chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
119- echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
120- echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
121- wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
122- sudo apt update
123- sudo apt install -y libsgx-launch libsgx-urts
124- source /opt/intel/sgxsdk/environment
115+ uses : ./.github/actions/install-linux-sgx
116+ with :
117+ os : ${{ matrix.os }}
125118
126119 - name : checkout
127120 uses : actions/checkout@v4
@@ -150,15 +143,12 @@ jobs:
150143 # $LLVM_LAZY_JIT_BUILD_OPTIONS,
151144 # $LLVM_EAGER_JIT_BUILD_OPTIONS,
152145 ]
153- os : [ubuntu-20.04 ]
146+ os : [ $TARGET_OS ]
154147 iwasm_make_options_feature : [
155148 # Features to be tested: IPFS
156149 " -DWAMR_BUILD_SGX_IPFS=1" ,
157150 ]
158151 platform : [linux-sgx]
159- include :
160- - os : ubuntu-20.04
161- llvm_cache_key : ${{ needs.build_llvm_libraries.outputs.cache_key }}
162152
163153 steps :
164154 - name : checkout
@@ -169,33 +159,10 @@ jobs:
169159 with :
170160 os : ${{ matrix.os }}
171161
172- # - name: build wasi-libc (needed for wasi-threads)
173- # run: |
174- # mkdir wasi-libc
175- # cd wasi-libc
176- # git init
177- # # "Fix a_store operation in atomic.h" commit on main branch
178- # git fetch https://github.com/WebAssembly/wasi-libc \
179- # 1dfe5c302d1c5ab621f7abf04620fae92700fd22
180- # git checkout FETCH_HEAD
181- # make \
182- # AR=/opt/wasi-sdk/bin/llvm-ar \
183- # NM=/opt/wasi-sdk/bin/llvm-nm \
184- # CC=/opt/wasi-sdk/bin/clang \
185- # THREAD_MODEL=posix
186- # working-directory: core/deps
187-
188162 - name : install SGX SDK and necessary libraries
189- run : |
190- mkdir -p /opt/intel
191- cd /opt/intel
192- wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
193- chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
194- echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
195- echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
196- wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
197- sudo apt update
198- sudo apt install -y libsgx-launch libsgx-urts
163+ uses : ./.github/actions/install-linux-sgx
164+ with :
165+ os : ${{ matrix.os }}
199166
200167 - name : Build iwasm for testing samples
201168 run : |
@@ -217,7 +184,7 @@ jobs:
217184 ./core/deps/llvm/build/lib
218185 ./core/deps/llvm/build/libexec
219186 ./core/deps/llvm/build/share
220- key : ${{ matrix.llvm_cache_key }}
187+ key : ${{ needs.build_llvm_libraries.outputs.cache_key }}
221188 fail-on-cache-miss : true
222189
223190 - name : Build wamrc only for testing samples in aot mode
@@ -252,13 +219,14 @@ jobs:
252219
253220 spec_test_default :
254221 needs : [build_iwasm, build_llvm_libraries]
255- runs-on : ubuntu-20.04
222+ runs-on : ${{ matrix.os }}
256223 strategy :
257224 matrix :
258225 running_mode : ["classic-interp", "fast-interp", "aot", "fast-jit"]
259226 # FIXME: use binary release(adding -b) instead of building from source after upgrading to 22.04
260- test_option : ["-x -p -s spec -P", "-x -p -s spec -S -P", "-x -p -s spec -X -P"]
261- llvm_cache_key : ["${{ needs.build_llvm_libraries.outputs.cache_key }}"]
227+ test_option :
228+ ["-x -p -s spec -P", "-x -p -s spec -S -P", "-x -p -s spec -X -P"]
229+ os : [ $TARGET_OS ]
262230 exclude :
263231 # classic-interp, fast-interp and fast-jit don't support simd
264232 - running_mode : " classic-interp"
@@ -290,23 +258,16 @@ jobs:
290258 ./core/deps/llvm/build/lib
291259 ./core/deps/llvm/build/libexec
292260 ./core/deps/llvm/build/share
293- key : ${{ matrix.llvm_cache_key }}
261+ key : ${{ needs.build_llvm_libraries.outputs.cache_key }}
294262
295263 - name : Quit if cache miss
296264 if : matrix.running_mode == 'aot' && steps.retrieve_llvm_libs.outputs.cache-hit != 'true'
297265 run : echo "::error::can not get prebuilt llvm libraries" && exit 1
298266
299267 - name : install SGX SDK and necessary libraries
300- run : |
301- mkdir -p /opt/intel
302- cd /opt/intel
303- wget https://download.01.org/intel-sgx/sgx-linux/2.15/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.15.100.3.bin
304- chmod +x sgx_linux_x64_sdk_2.15.100.3.bin
305- echo 'yes' | ./sgx_linux_x64_sdk_2.15.100.3.bin
306- echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
307- wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
308- sudo apt update
309- sudo apt install -y libsgx-launch libsgx-urts
268+ uses : ./.github/actions/install-linux-sgx
269+ with :
270+ os : ${{ matrix.os }}
310271
311272 - name : install for wabt compilation
312273 run : sudo apt update && sudo apt install -y ninja-build
0 commit comments