diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml new file mode 100644 index 000000000..bb546a8a8 --- /dev/null +++ b/.github/workflows/storybook.yml @@ -0,0 +1,29 @@ +name: Storybook tests +on: + pull_request: + types: [opened, reopened, synchronize, edited] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'npm' + - name: Install dependencies + run: npm install + - name: Install Playwright + run: npx playwright install --with-deps + - name: Build Storybook + run: npm run build-storybook --quiet + - name: Serve Storybook and run tests + run: | + npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ + "npx http-server storybook-static --port 6006 --silent" \ + "npx wait-on tcp:6006 && npm run test-storybook --coverage" + - uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}