summaryrefslogtreecommitdiffhomepage
path: root/.github
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-03-06 00:02:51 +0000
committerAndrew Clayton <a.clayton@nginx.com>2024-03-07 19:47:46 +0000
commit0cee7d1a481abef182655425c927e903df0ba4c2 (patch)
tree14b0440e1727a7fc9fbaa5935becae13c217ef8e /.github
parent8032ce31e37107ea538ebb50b7e792cf5fd3fe21 (diff)
downloadunit-0cee7d1a481abef182655425c927e903df0ba4c2.tar.gz
unit-0cee7d1a481abef182655425c927e903df0ba4c2.tar.bz2
Add GitHub workflow for wasm-wasi-component
This adds a GitHub CI workflow for the new wasm-wasi-component language module. Some things of note. 1) We need to special case 'wasm-wasi-component' in the 'Output build metadata' section as we are splitting the module names on '-' to split them into name and version. 2) Apart from needing to tell bindgen about the njs include paths, we also need to explicitly specify which version of clang to use to work around an issue with multiple versions of clang installed. Link: <https://gitlab.freedesktop.org/mesa/mesa/-/issues/7268> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci.yml40
1 files changed, 35 insertions, 5 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d5a2529b..4de8a3b6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -49,6 +49,8 @@ jobs:
os: ubuntu-latest
- build: wasm
os: ubuntu-latest
+ - build: wasm-wasi-component
+ os: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -57,8 +59,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}*"
@@ -293,6 +299,27 @@ jobs:
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: |
+ CLANG_PATH=/usr/bin/clang-15 \
+ BINDGEN_EXTRA_CLANG_ARGS="-I../../njs/src -I../../njs/build" \
+ make wasm-wasi-component
+ if: steps.metadata.outputs.module == 'wasm-wasi-component'
+
+ ##
## Tests
##
@@ -307,15 +334,18 @@ 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: |
sudo -H 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: |
sudo -E 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'