Skip to content

Commit 337cba4

Browse files
committed
ci: Enable the wasm-wasi-component tests
We now have tests for this module via commit cad6aed ("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>
1 parent 19cd88e commit 337cba4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ jobs:
318318
- name: Setup rust
319319
run: |
320320
curl https://sh.rustup.rs | sh -s -- -y
321+
cargo install cargo-component
321322
if: steps.metadata.outputs.module == 'wasm-wasi-component'
322323

323324
- name: Configure wasm-wasi-component
@@ -347,18 +348,22 @@ jobs:
347348
- uses: actions/setup-python@v5
348349
with:
349350
python-version: '3'
350-
if: steps.metadata.outputs.module != 'wasm' &&
351-
steps.metadata.outputs.module != 'wasm-wasi-component'
351+
if: steps.metadata.outputs.module != 'wasm'
352352

353353
- name: Install pytest
354354
run: |
355-
sudo -H pip install pytest
356-
if: steps.metadata.outputs.module != 'wasm' &&
357-
steps.metadata.outputs.module != 'wasm-wasi-component'
355+
if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
356+
pip install pytest
357+
else
358+
sudo -H pip install pytest
359+
fi
360+
if: steps.metadata.outputs.module != 'wasm'
358361

359362
- name: Run ${{ steps.metadata.outputs.module }} tests
360363
run: |
361-
sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }}
362-
# Skip pytest if wasm build, as there are no tests yet
363-
if: steps.metadata.outputs.module != 'wasm' &&
364-
steps.metadata.outputs.module != 'wasm-wasi-component'
364+
if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
365+
pytest --print-log ${{ steps.metadata.outputs.testpath }}
366+
else
367+
sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }}
368+
fi
369+
if: steps.metadata.outputs.module != 'wasm'

0 commit comments

Comments
 (0)