From 41cc3a5512a0f730e743e4efed6e9d0767c68a6e Mon Sep 17 00:00:00 2001 From: Kyzyl-ool Kezhik Date: Tue, 23 Apr 2024 15:45:59 +0200 Subject: [PATCH] ci(storybook): make tests mandatory (#1543) Co-authored-by: Kezhik Kyzyl-ool --- .github/workflows/pr-storybook-tests.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr-storybook-tests.yml b/.github/workflows/pr-storybook-tests.yml index 7198f7d67a..2b62c692e1 100644 --- a/.github/workflows/pr-storybook-tests.yml +++ b/.github/workflows/pr-storybook-tests.yml @@ -1,10 +1,7 @@ name: PR Storybook Tests on: - workflow_run: - workflows: ['PR Preview Deploy'] - types: - - completed + pull_request: jobs: tests: @@ -19,7 +16,12 @@ jobs: run: npm ci - name: Install Playwright Browsers run: npx playwright install --with-deps - - name: Storybook Tests + - name: Build Storybook Static + run: npm run build-storybook + - name: Serve Storybook and run tests + run: | + npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ + "npx http-server storybook-static --port 7007 --silent" \ + "npx wait-on $PR_PREVIEW_URL && npm run test-storybook" env: - PR_PREVIEW_URL: "https://preview.gravity-ui.com/uikit/${{github.event.pull_request.number}}" - run: npm run test-storybook + PR_PREVIEW_URL: http://127.0.0.1:7007