Skip to content

Commit

Permalink
[WIP] Add GitHub workflow for wasm-wasi-component
Browse files Browse the repository at this point in the history
  • Loading branch information
ac000 committed Mar 6, 2024
1 parent c2f7f29 commit 821b5df
Showing 1 changed file with 32 additions and 5 deletions.
37 changes: 32 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
os: ubuntu-latest
- build: wasm
os: ubuntu-latest
- build: wasm-wasi-component
os: ubuntu-latest



steps:
- uses: actions/checkout@v4
Expand All @@ -73,8 +77,12 @@ jobs:
- name: Output build metadata
id: metadata
run: |
# Split the build name by '-' into module and version
IFS='-' read -r module version <<< "${{ matrix.build }}"
if [ "${{ matrix.build }}" = "wasm-wasi-component" ]; then
module="wasm-wasi-component"
else
# Split the build name by '-' into module and version
IFS='-' read -r module version <<< "${{ matrix.build }}"
fi
testpath="test/test_${module}*"
Expand Down Expand Up @@ -317,6 +325,25 @@ jobs:
make wasm
if: steps.metadata.outputs.module == 'wasm'

##
## wasm-wasi-component
##

- name: Setup rust
run: |
curl https://sh.rustup.rs | sh -s -- -y
if: steps.metadata.outputs.module == 'wasm-wasi-component'

- name: Configure wasm-wasi-component
run: |
./configure wasm-wasi-component
if: steps.metadata.outputs.module == 'wasm-wasi-component'

- name: Make wasm-wasi-component
run: |
RUSTFLAGS="llvm-args=-I../../njs/src" make wasm-wasi-component
if: steps.metadata.outputs.module == 'wasm-wasi-component'

##
## Tests
##
Expand All @@ -325,15 +352,15 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3'
if: steps.metadata.outputs.module != 'wasm'
if: steps.metadata.outputs.module != 'wasm' && steps.metadata.outputs.module != 'wasm-wasi-component'

- name: Install pytest
run: |
pip install pytest
if: steps.metadata.outputs.module != 'wasm'
if: steps.metadata.outputs.module != 'wasm' && steps.metadata.outputs.module != 'wasm-wasi-component'

- name: Run ${{ steps.metadata.outputs.module }} tests
run: |
pytest --print-log ${{ steps.metadata.outputs.testpath }}
# Skip pytest if wasm build, as there are no tests yet
if: steps.metadata.outputs.module != 'wasm'
if: steps.metadata.outputs.module != 'wasm' && steps.metadata.outputs.module != 'wasm-wasi-component'

0 comments on commit 821b5df

Please sign in to comment.