Skip to content

WIP ci: build plugins #22

WIP ci: build plugins

WIP ci: build plugins #22

Workflow file for this run

---
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"'