From b329c9d4900640f8701029adf404d7e0c205b67a Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Fri, 14 Jan 2022 00:14:06 -0500 Subject: [PATCH] ci: support `test.skip` [skip ci] --- .github/examples.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/examples.mjs b/.github/examples.mjs index f9bce72c..f5082e35 100644 --- a/.github/examples.mjs +++ b/.github/examples.mjs @@ -19,14 +19,14 @@ async function plugin(id) { const path = paths.join(__plugins, id) const readme = paths.join(path, "README.md") const examples = paths.join(path, "examples.yml") - const tests = paths.join(__test_plugins, id) + const tests = paths.join(__test_plugins, `${id}.yml`) return { readme:{ path:readme, content:`${await fs.readFile(readme)}` }, tests:{ - path:paths.join(__test_plugins, `${id}.yml`) + path:tests }, examples:fss.existsSync(examples) ? yaml.load(await fs.readFile(examples), "utf8") ?? [] : [], options:plugins[id].readme.table @@ -59,6 +59,8 @@ for (const id of Object.keys(plugins)) { ) //Plugin tests await fs.writeFile(tests.path, yaml.dump(examples.map(({prod, test = {}, name = "", ...step}) => { + if (test.skip) + return null const result = {name:`${plugins[id].name} - ${name}`, ...step, ...test} test.with ??= {} for (const [k, v] of Object.entries(result.with)) { @@ -71,7 +73,7 @@ for (const id of Object.keys(plugins)) { delete result.with.base delete result.with.filename return result - }))) + }).filter(t => t))) }