|
| 1 | +--- |
| 2 | +name: Build on Linux |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + plugins: |
| 8 | + type: string |
| 9 | + required: true |
| 10 | + version: |
| 11 | + type: string |
| 12 | + default: wip # TODO |
| 13 | + |
| 14 | +permissions: {} |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + include: ${{ fromJSON(inputs.plugins) }} |
| 22 | + name: ${{ matrix.plugin }} |
| 23 | + runs-on: ${{ matrix.runner }} |
| 24 | + container: |
| 25 | + image: wasmedge/wasmedge:${{ matrix.docker_tag }} |
| 26 | + env: |
| 27 | + bin: lib${{ matrix.target }}.so |
| 28 | + target: ${{ matrix.test }} # TODO: use matrix.target on release |
| 29 | + test_dir: build/test/plugins/${{ matrix.dir }} |
| 30 | + output_dir: build/plugins/${{ matrix.dir }} |
| 31 | + steps: |
| 32 | + - id: var |
| 33 | + run: | |
| 34 | + echo "artifact=WasmEdge-plugin-${{ matrix.plugin }}-${{ inputs.version }}-${{ matrix.asset_tag }}.tar.gz" >> "${GITHUB_OUTPUT}" |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + with: |
| 37 | + fetch-depth: 0 |
| 38 | + repository: 'WasmEdge/WasmEdge' # TODO: checkout plugins from this repository |
| 39 | + - name: Ensure git safe directory |
| 40 | + run: | |
| 41 | + git config --global --add safe.directory "$(pwd)" |
| 42 | + - name: Build ${{ matrix.plugin }} |
| 43 | + run: | |
| 44 | + # TODO: Disable BUILD_TESTS on release |
| 45 | + # TODO: Enable CXX11_ABI if not manylinux_2_28 |
| 46 | + cmake -Bbuild -GNinja \ |
| 47 | + -DCMAKE_BUILD_TYPE=Release \ |
| 48 | + -DWASMEDGE_BUILD_TESTS=ON \ |
| 49 | + -DWASMEDGE_BUILD_TOOLS=OFF \ |
| 50 | + -DWASMEDGE_USE_LLVM=OFF \ |
| 51 | + -DWASMEDGE_USE_CXX11_ABI=OFF \ |
| 52 | + "-DOPENSSL_ROOT_DIR=${OpenSSL_DIR}" \ |
| 53 | + ${{ matrix.options }} |
| 54 | + cmake --build build --target "${target}" |
| 55 | +
|
| 56 | + cp -f "${output_dir}/${bin}" "${bin}" |
| 57 | + tar -zcvf "${{ steps.var.outputs.artifact }}" "${bin}" |
| 58 | + - name: Test ${{ matrix.plugin }} |
| 59 | + run: | |
| 60 | + cd "${test_dir}" && "./${target}" |
| 61 | + - name: Upload ${{ steps.var.outputs.artifact }} |
| 62 | + uses: actions/upload-artifact@v4 |
| 63 | + with: |
| 64 | + name: ${{ steps.var.outputs.artifact }} |
| 65 | + path: ${{ steps.var.outputs.artifact }} |
0 commit comments