summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2024-08-26 15:35:48 +0100
committerAndrew Clayton <a.clayton@nginx.com>2024-08-28 22:18:37 +0100
commit337cba43a5b74922bb38992ed09d3ddfe673e5e7 (patch)
tree81e0b4683b49a47d6f0aeb607c83e37e39ad4f1f
parent19cd88ef907a3a9248d58a987070f18749ff874b (diff)
downloadunit-337cba43a5b74922bb38992ed09d3ddfe673e5e7.tar.gz
unit-337cba43a5b74922bb38992ed09d3ddfe673e5e7.tar.bz2
ci: Enable the wasm-wasi-component tests
We now have tests for this module via commit cad6aed52 ("Tests: initial "wasm-wasi-component" test"). We need to install cargo-component for this test target. Also the only way I found I could get this test to run was by running as non-root. The issue I was seeing was that despite cargo being installed into /home/runner/.cargo/bin *and* that being in the path, it kept claiming it couldn't find cargo. E.g. $ sudo -E echo $PATH Showed /home/runner/.cargo/bin in there. $ sudo -E /home/runner/.cargo/bin/cargo -V Worked. $ sudo -E cargo -V cargo command not found. (Also other oddities, despite claiming to be using bash, it couldn't find shell builtins like 'hash' and 'export', perhaps some Ubuntu weirdness...) However, no problem, there is *no* need for it run as root anyway so result! Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r--.github/workflows/ci.yml23
1 files changed, 14 insertions, 9 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 541b7201..47dd0af3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -318,6 +318,7 @@ jobs:
- name: Setup rust
run: |
curl https://sh.rustup.rs | sh -s -- -y
+ cargo install cargo-component
if: steps.metadata.outputs.module == 'wasm-wasi-component'
- name: Configure wasm-wasi-component
@@ -347,18 +348,22 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3'
- if: steps.metadata.outputs.module != 'wasm' &&
- steps.metadata.outputs.module != 'wasm-wasi-component'
+ if: steps.metadata.outputs.module != 'wasm'
- name: Install pytest
run: |
- sudo -H pip install pytest
- if: steps.metadata.outputs.module != 'wasm' &&
- steps.metadata.outputs.module != 'wasm-wasi-component'
+ if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
+ pip install pytest
+ else
+ sudo -H pip install pytest
+ fi
+ if: steps.metadata.outputs.module != 'wasm'
- 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' &&
- steps.metadata.outputs.module != 'wasm-wasi-component'
+ if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
+ pytest --print-log ${{ steps.metadata.outputs.testpath }}
+ else
+ sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }}
+ fi
+ if: steps.metadata.outputs.module != 'wasm'