WIP ci: build plugins #16
This file contains hidden or 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
--- | |
name: Parse | |
on: | |
pull_request: | |
branches: [main] | |
paths: | |
- '.github/plugins.json' | |
- '.github/scripts/parse-plugins.js' | |
- '.github/workflows/parse-plugins.yml' | |
workflow_call: | |
inputs: | |
workflow_call: # workaround to distinguish ${{ github.event }} | |
type: boolean | |
default: true | |
outputs: | |
plugins: | |
value: ${{ jobs.parse.outputs.plugins }} | |
jobs: | |
parse: | |
name: Parse configuration file | |
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)); | |
core.setOutput("plugins", config); | |
test: | |
if: ${{ !inputs.workflow_call }} | |
needs: parse | |
name: Self-testing | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get wasi_crypto target | |
run: | | |
echo "target=$(echo '${{ needs.parse.outputs.plugins }}' | jq '.manylinux_2_28_x86_64[] | select(.plugin == "wasi_crypto") | .target')" >> "${GITHUB_ENV}" | |
- name: Check wasi_crypto target | |
run: | | |
echo "${target}" | |
test "${target}" = '"wasmedgePluginWasiCrypto"' |