Filter by cadence

This commit is contained in:
Tom Coleman 2022-08-05 16:42:19 +10:00
parent 4777e943e8
commit 1b075df5da
3 changed files with 18 additions and 7 deletions

View File

@ -3,6 +3,7 @@ export default {
'cra/default-js': {
name: 'Create React App (Javascript)',
script: 'npx create-react-app .',
cadence: ['ci', 'daily', 'weekly'],
expected: {
framework: '@storybook/cra',
renderer: '@storybook/react',
@ -12,6 +13,7 @@ export default {
'cra/default-ts': {
name: 'Create React App (Typescript)',
script: 'npx create-react-app . --template typescript',
cadence: ['ci', 'daily', 'weekly'],
expected: {
framework: '@storybook/cra',
renderer: '@storybook/react',

View File

@ -43,16 +43,19 @@ export const options = createOptions({
});
async function run() {
const { script: commandline, parallel } = await getOptionsOrPrompt(
'yarn multiplex-templates',
options
);
const {
cadence,
script: commandline,
parallel,
} = await getOptionsOrPrompt('yarn multiplex-templates', options);
const command = await parseCommand(commandline);
const allTemplates = Object.keys(TEMPLATES);
// TODO -- filter by cadence
const templates = filterDataForCurrentCircleCINode(allTemplates);
const allTemplates = Object.keys(TEMPLATES) as (keyof typeof TEMPLATES)[];
const cadenceTemplates = allTemplates.filter((template) =>
TEMPLATES[template].cadence.includes(cadence)
);
const templates = filterDataForCurrentCircleCINode(cadenceTemplates);
const toAwait = [];
for (const template of templates) {

View File

@ -2,6 +2,11 @@
cra/default-js:
name: "Create React App (Javascript)"
script: "npx create-react-app ."
# how often to test this template:
# ci: every push
# daily: during our daily job
# weekly; during our weekly job
cadence: ["ci", "daily", "weekly"]
expected:
framework: "@storybook/cra"
renderer: "@storybook/react"
@ -10,6 +15,7 @@ cra/default-js:
cra/default-ts:
name: "Create React App (Typescript)"
script: "npx create-react-app . --template typescript"
cadence: ["ci", "daily", "weekly"]
expected:
framework: "@storybook/cra"
renderer: "@storybook/react"