From 5772b1d5447a4caeb7f3490d1025a755ea77ca73 Mon Sep 17 00:00:00 2001 From: jptaranto Date: Fri, 2 Aug 2024 16:19:23 +1000 Subject: [PATCH 1/2] New test frontend jobs --- src/jobs/test_frontend.yml | 21 +++++++++++++++++++++ src/jobs/test_storybook.yml | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/jobs/test_frontend.yml create mode 100644 src/jobs/test_storybook.yml diff --git a/src/jobs/test_frontend.yml b/src/jobs/test_frontend.yml new file mode 100644 index 0000000..a389059 --- /dev/null +++ b/src/jobs/test_frontend.yml @@ -0,0 +1,21 @@ +description: | + Frontend linting and test. + + The following npm commands are required and will be called: + - npm run lint + - npm run test:ci + +parameters: + executor: + type: executor + description: The executor to use. + +executor: <> + +steps: + - checkout + - attach_workspace: + at: /data + - run: + name: "Test" + command: npm run test:ci diff --git a/src/jobs/test_storybook.yml b/src/jobs/test_storybook.yml new file mode 100644 index 0000000..54775d3 --- /dev/null +++ b/src/jobs/test_storybook.yml @@ -0,0 +1,24 @@ +description: | + Tests storybook. + + The following npm commands are required and will be called: + - npm run http-server + - npm run test-storybook:ci + +docker: + - image: mcr.microsoft.com/playwright:v1.44.1-jammy + +steps: + - checkout + - attach_workspace: + at: /data + - run: + name: "Start Storybook" + command: npm run http-server + background: true + - run: + name: "Install Playwright" + command: npx playwright install --with-deps + - run: + name: "Test Storybook" + command: npm run test-storybook:ci \ No newline at end of file From 5e04e606ee9bcd55d5f297c1d62c6d24346d4b6f Mon Sep 17 00:00:00 2001 From: jptaranto Date: Fri, 2 Aug 2024 16:19:32 +1000 Subject: [PATCH 2/2] allow storybook param without breaking anything --- src/jobs/build_frontend.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jobs/build_frontend.yml b/src/jobs/build_frontend.yml index 9e34611..b80fb91 100644 --- a/src/jobs/build_frontend.yml +++ b/src/jobs/build_frontend.yml @@ -17,6 +17,10 @@ parameters: description: The Drupal library path. type: string default: "" + storybook_path: + description: Path to built Storybook or KSS. + type: string + default: app/styleguide init: type: steps description: Initialise the front-end dependencies. @@ -65,7 +69,7 @@ steps: - persist_to_workspace: root: /data paths: - - app/styleguide + - <> - <> - <>/css - <>/js