Skip to content

Commit e645ea8

Browse files
committed
ci: build plugins
Signed-off-by: Yi Huang <[email protected]>
1 parent 6afe0e2 commit e645ea8

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

.github/workflows/build-on-linux.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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 }}

.github/workflows/build.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Build
3+
4+
on:
5+
pull_request:
6+
branches: [main]
7+
8+
permissions: {}
9+
10+
jobs:
11+
parse:
12+
uses: ./.github/workflows/parse-plugins.yml
13+
14+
linux:
15+
needs: parse
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- name: manylinux_2_28 (x86_64)
21+
plugins: ${{ fromJSON(needs.parse.outputs.plugins).manylinux_2_28_x86_64 }}
22+
name: ${{ matrix.name }}
23+
uses: ./.github/workflows/build-on-linux.yml
24+
with:
25+
plugins: ${{ toJSON(matrix.plugins) }}
26+
secrets: inherit

0 commit comments

Comments
 (0)