Skip to content

Commit 5d006ad

Browse files
authored
Reuse build llvm libraries for spec test on nuttx (#1838)
Fix daily CI break on NuttX.
1 parent ba5cdbe commit 5d006ad

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

.github/workflows/spec_test_on_nuttx.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@ on:
99

1010
workflow_dispatch:
1111

12+
env:
13+
LLVM_CACHE_SUFFIX: "build-llvm_libraries_ex"
14+
1215
jobs:
16+
build_llvm_libraries:
17+
uses: ./.github/workflows/build_llvm_libraries.yml
18+
with:
19+
runs-on: "['ubuntu-22.04']"
20+
1321
spec_test_on_qemu:
14-
runs-on: ubuntu-22.04
22+
runs-on: ${{ matrix.os }}
23+
needs: [build_llvm_libraries]
1524
strategy:
1625
matrix:
26+
os: [ubuntu-22.04]
1727
nuttx_board_config: [
1828
# cortex-a9
1929
"boards/arm/imx6/sabre-6quad/configs/nsh",
@@ -61,6 +71,25 @@ jobs:
6171
repository: ${{ github.repository }}
6272
path: apps/interpreters/wamr/wamr
6373

74+
- name: Get LLVM libraries
75+
id: cache_llvm
76+
uses: actions/cache@v3
77+
with:
78+
path: |
79+
./core/deps/llvm/build/bin
80+
./core/deps/llvm/build/include
81+
./core/deps/llvm/build/lib
82+
./core/deps/llvm/build/libexec
83+
./core/deps/llvm/build/share
84+
key: ${{ matrix.os }}-${{ env.LLVM_CACHE_SUFFIX }}
85+
86+
- name: Quit if cache miss
87+
if: steps.cache_llvm.outputs.cache-hit != 'true'
88+
run: echo "::error::can not get prebuilt llvm libraries" && exit 1
89+
90+
- name: Copy LLVM
91+
run: cp -r core/deps/llvm apps/interpreters/wamr/wamr/core/deps/llvm
92+
6493
- name: Enable WAMR for NuttX
6594
run: |
6695
find nuttx/boards -name defconfig | xargs sed -i '$a\CONFIG_INTERPRETERS_WAMR=y\nCONFIG_INTERPRETERS_WAMR_AOT=y\nCONFIG_INTERPRETERS_WAMR_FAST=y\nCONFIG_INTERPRETERS_WAMR_LOG=y\nCONFIG_INTERPRETERS_WAMR_LIBC_BUILTIN=y\nCONFIG_INTERPRETERS_WAMR_REF_TYPES=y\nCONFIG_INTERPRETERS_WAMR_ENABLE_SPEC_TEST=y\nCONFIG_INTERPRETERS_WAMR_SHARED_MEMORY=y\nCONFIG_INTERPRETERS_WAMR_BULK_MEMORY=y\n'
@@ -69,8 +98,7 @@ jobs:
6998
- name: Build wamrc
7099
working-directory: apps/interpreters/wamr/wamr/wamr-compiler
71100
run: |
72-
sudo apt install llvm-13-dev
73-
cmake -Bbuild -DWAMR_BUILD_WITH_CUSTOM_LLVM=1 .
101+
cmake -Bbuild .
74102
cmake --build build
75103
76104
- name: Build

0 commit comments

Comments
 (0)