-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Yi Huang <[email protected]>
- Loading branch information
Showing
5 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"plugins": [ | ||
{ | ||
"plugin": "wasi_crypto", | ||
"dir": "wasi_crypto", | ||
"target": "wasmedgePluginWasiCrypto", | ||
"test": "wasiCryptoTests", | ||
"options": "-DWASMEDGE_PLUGIN_WASI_CRYPTO=ON", | ||
"platforms": [ | ||
{ | ||
"key": "manylinux_2_28_x86_64" | ||
}, | ||
{ | ||
"key": "ubuntu_2004_x86_64" | ||
} | ||
] | ||
}, | ||
{ | ||
"plugin": "wasi_nn-openvino", | ||
"dir": "wasi_nn", | ||
"target": "wasmedgePluginWasiNN", | ||
"test": "wasiNNTests", | ||
"options": "-DWASMEDGE_PLUGIN_WASI_NN_BACKEND=OpenVINO", | ||
"platforms": [ | ||
{ | ||
"key": "ubuntu_2004_x86_64" | ||
} | ||
] | ||
} | ||
], | ||
"platforms": { | ||
"manylinux_2_28_x86_64": { | ||
"runner": "ubuntu-latest", | ||
"docker_tag": "manylinux_2_28_x86_64-plugins-deps", | ||
"asset_tag": "manylinux_2_28_x86_64" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module.exports.parse = (config) => { | ||
let map = new Map(); | ||
for (const [key, def] of Object.entries(config.platforms)) { | ||
map.set(key, config.plugins | ||
.map((plugin) => { | ||
let platform = plugin.platforms.find((platform) => platform.key == key); | ||
if (undefined == platform) | ||
return undefined; | ||
let copy = { ...plugin, ...def }; | ||
delete copy.platforms; | ||
copy.options = [plugin.options, platform.options].join(" "); | ||
return copy; | ||
}) | ||
.filter((plugin) => undefined != plugin)); | ||
} | ||
return map; | ||
}; | ||
|
||
if (require.main === module) { | ||
const { parse } = module.exports; | ||
const fs = require("fs"); | ||
const s = fs.readFileSync("plugins.json"); | ||
const o = JSON.parse(s); | ||
let config = parse(o); | ||
console.log(config.get("manylinux_2_28_x86_64")); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
name: Build on Linux | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
plugin: | ||
type: string | ||
required: true | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
echo: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo "${{ inputs.plugin }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
parse: | ||
uses: ./.github/workflows/parse-plugins.yml | ||
|
||
echo: | ||
needs: parse | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: | | ||
echo "${{ needs.parse.outputs.plugins }}" | ||
manylinux_2_28: | ||
needs: parse | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: ${{ fromJSON(needs.parse.outputs.plugins).manylinux_2_28_x86_64 }} | ||
uses: ./.github/workflows/build-on-linux.yml | ||
with: | ||
plugin: ${{ matrix.plugin }} | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Parse plugins | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
plugins: | ||
value: ${{ jobs.parse.outputs.plugins }} | ||
|
||
jobs: | ||
parse: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
plugins: ${{ steps.readfile.outputs.plugins }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: readfile | ||
uses: actions/github-script@v7 | ||
with: | ||
result-encoding: string | ||
script: | | ||
const { parse } = require(".github/scripts/parse-plugins.js"); | ||
const fs = require("fs"); | ||
const s = fs.readFileSync(".github/plugins.json"); | ||
const config = parse(JSON.parse(s)); | ||
console.log(JSON.stringify(config)); | ||
core.setOutput("plugins", config); |