-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.42 KB
/
parse-plugins.yml
File metadata and controls
52 lines (48 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
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 the first target from ubuntu2004_cuda11
run: |
echo "target=${{ fromJSON(needs.parse.outputs.plugins).ubuntu2004_cuda11[0].target }}" >> "${GITHUB_ENV}"
- name: Check target
run: |
echo "${target}"
test "${target}" = 'wasmedgePluginWasmEdgeStableDiffusion'