nginx / unit

NGINX Unit - universal web app server - a lightweight and versatile open source server that simplifies the application stack by natively executing application code across eight different programming language runtimes.
https://unit.nginx.org
Apache License 2.0
5.25k stars 322 forks source link

Add GitHub workflow for wasm-wasi-component #1175

Closed ac000 closed 3 months ago

ac000 commented 3 months ago

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.

ac000 commented 3 months ago
$ git range-diff 16bd12b3...0cee7d1a
-:  -------- > 1:  8032ce31 Test with root access in GitHub workflows
1:  16bd12b3 ! 2:  0cee7d1a Add GitHub workflow for wasm-wasi-component
    @@ .github/workflows/ci.yml: jobs:

            - name: Install pytest
              run: |
    -           pip install pytest
    +           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: |
    -           pytest --print-log ${{ steps.metadata.outputs.testpath }}
    +           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' &&