Skip to content

Commit

Permalink
ci: test runwasi example as well
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jun 9, 2023
1 parent 7c22e1a commit ab64fe3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,16 @@ jobs:
mkdir -p ${{github.workspace}}/artifacts
cp ${{env.builddir}}/*.tgz ${{github.workspace}}/artifacts/
- name: Test example app with the library we built
- name: Test "app" example with the library we built
if: matrix.BUILD_TYPE == 'Release' && matrix.arch == 'native'
run: |
./test/test-example-app.sh ${{env.builddir}}/toywasm-v*.tgz ${{env.builddir}}/spectest.wasm
./test/test-example.sh app ${{env.builddir}}/toywasm-v*.tgz ${{env.builddir}}/spectest.wasm
- name: Test "runwasi" example with the library we built
if: matrix.BUILD_TYPE == 'Release' && matrix.arch == 'native'
run: |
wat2wasm wat/wasi/hello.wat
./test/test-example.sh runwasi ${{env.builddir}}/toywasm-v*.tgz hello.wasm
- name: Upload artifacts
if: matrix.name != 'noname'
Expand Down
9 changes: 5 additions & 4 deletions test/test-example-app.sh → test/test-example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

set -e

TGZ=$1
MODULE=$2
APP=$1
TGZ=$2
shift 2

DIR=$(mktemp -d)
gzip -cd ${TGZ} | (cd ${DIR} && pax -r)

cd examples/app
cd examples/${APP}
BUILDDIR=$(mktemp -d)
cmake -B ${BUILDDIR} -DCMAKE_INSTALL_PREFIX=${DIR} .
cmake --build ${BUILDDIR}
${BUILDDIR}/app ${MODULE}
${BUILDDIR}/${APP} "$@"

0 comments on commit ab64fe3

Please sign in to comment.