Skip to content

Commit

Permalink
Using docker image for nuttx spectest (bytecodealliance#2887)
Browse files Browse the repository at this point in the history
And disable running the nuttx spectest CI every time PR merged since
it will consume too much runners to slow down the other checks.
  • Loading branch information
no1wudi authored Dec 11, 2023
1 parent 63696ba commit c6848e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 45 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build_llvm_libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
arch:
required: true
type: string
container_image:
required: false
type: string
outputs:
cache_key:
description: "A cached key of LLVM libraries"
Expand All @@ -19,6 +22,10 @@ on:
jobs:
build_llvm_libraries:
runs-on: ${{ inputs.os }}
# Using given container image if it is specified.
# Otherwise, it will be ignored by the runner.
container:
image: ${{ inputs.container_image }}
outputs:
key: ${{ steps.create_lib_cache_key.outputs.key}}

Expand Down Expand Up @@ -71,8 +78,9 @@ jobs:
0-ccache-${{ inputs.os }}
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'ubuntu-22.04'

# Don't install dependencies if the cache is hit or running in docker container
- run: sudo apt install -y ccache ninja-build
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'ubuntu')
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && startsWith(inputs.os, 'ubuntu') && inputs.container_image == ''

- uses: actions/cache@v3
with:
Expand Down
52 changes: 8 additions & 44 deletions .github/workflows/spec_test_on_nuttx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ name: spec test on nuttx
on:
pull_request:
types:
- closed
branches:
- main
- opened
- synchronize
paths:
- ".github/workflows/spec_test_on_nuttx.yml"

schedule:
- cron: '0 0 * * *'
Expand All @@ -27,10 +28,13 @@ jobs:
with:
os: "ubuntu-22.04"
arch: "ARM RISCV AArch64"
container_image: ghcr.io/apache/nuttx/apache-nuttx-ci-linux@sha256:4b4cbf0b70512e61ada9cdcb76b97e90ad478b85e4d0774d05a95fa32caa8c39

spec_test_on_qemu:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: [build_llvm_libraries]
container:
image: ghcr.io/apache/nuttx/apache-nuttx-ci-linux@sha256:4b4cbf0b70512e61ada9cdcb76b97e90ad478b85e4d0774d05a95fa32caa8c39
strategy:
matrix:
target_config: [
Expand Down Expand Up @@ -91,32 +95,6 @@ jobs:
wamr_test_option: { mode: "-t aot -X" }

steps:
- name: Install Utilities
run: |
sudo apt install -y kconfig-frontends-nox genromfs
- name: Install ARM Compilers
if: startsWith(matrix.target_config.config, 'boards/arm')
run: |
sudo apt install -y gcc-arm-none-eabi
wget --quiet https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz
xz -d gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar.xz
tar xf gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf.tar
echo "$PWD/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin" >> $GITHUB_PATH
- name: Install RISC-V Compilers
if: startsWith(matrix.target_config.config, 'boards/risc-v')
run: |
curl -L https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v12.3.0-1/xpack-riscv-none-elf-gcc-12.3.0-1-linux-x64.tar.gz > riscv.tar.gz
tar xvf riscv.tar.gz
echo "$PWD/xpack-riscv-none-elf-gcc-12.3.0-1/bin" >> $GITHUB_PATH
- name: Install WASI-SDK
run: |
curl -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz > wasi-sdk.tar.gz
tar xvf wasi-sdk.tar.gz
sudo mv wasi-sdk-* /opt/wasi-sdk
- name: Checkout NuttX
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -190,20 +168,6 @@ jobs:
tools/configure.sh ${{ matrix.target_config.config }}
make -j$(nproc)
echo "firmware=$PWD/nuttx" >> $GITHUB_OUTPUT
- name: Install QEMU for ARM
if: startsWith(matrix.target_config.config, 'boards/arm')
run: |
curl -L https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v7.1.0-1/xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz > xpack-qemu-arm.tar.gz
tar xvf xpack-qemu-arm.tar.gz
echo $PWD/xpack-qemu-arm-7.1.0-1/bin >> $GITHUB_PATH
- name: Install QEMU for RISC-V
if: startsWith(matrix.target_config.config, 'boards/risc-v')
run: |
curl -L https://github.com/xpack-dev-tools/qemu-riscv-xpack/releases/download/v7.1.0-1/xpack-qemu-riscv-7.1.0-1-linux-x64.tar.gz > xpack-qemu-riscv.tar.gz
tar xvf xpack-qemu-riscv.tar.gz
echo PATH=$PATH:$PWD/xpack-qemu-riscv-7.1.0-1/bin >> $GITHUB_PATH
- name: Test
run: |
Expand Down

0 comments on commit c6848e4

Please sign in to comment.