diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 40c31754..d90a7c55 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -97,11 +97,4 @@ jobs: node-version: ${{ matrix.node }} - name: Test ๐Ÿงช - run: npm run coverage - - name: Codecov โ˜‚ - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - if: ${{ matrix.node == env.COVERAGE_VERSION }} - with: - directory: coverage + run: npm run test diff --git a/.github/workflows/storybook-tests.yml b/.github/workflows/storybook-tests.yml new file mode 100644 index 00000000..bcebba9c --- /dev/null +++ b/.github/workflows/storybook-tests.yml @@ -0,0 +1,29 @@ +name: Storybook Tests + +on: deployment_status + +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + if: github.event.deployment_status.state == 'success' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + - name: Install dependencies + run: yarn + - name: Install Playwright + run: npx playwright install --with-deps + - name: Run Storybook tests + run: yarn test-storybook -- --ci --coverage + env: + TARGET_URL: "${{ github.event.deployment_status.target_url }}" + - name: Codecov โ˜‚ + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + if: ${{ matrix.node == env.COVERAGE_VERSION }} + with: + directory: coverage diff --git a/package-lock.json b/package-lock.json index a3f68307..5c49e5b1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@chromatic-com/storybook": "^3.2.2", "@commitlint/cli": "^17.4.4", "@commitlint/config-conventional": "^17.4.4", + "@faker-js/faker": "^9.0.3", "@storybook/addon-a11y": "^8.4.7", "@storybook/addon-actions": "^8.4.7", "@storybook/addon-coverage": "^1.0.4", @@ -78,8 +79,8 @@ "typescript": "^5.4.3" }, "engines": { - "node": ">=18.12.0", - "npm": ">=7.0.0" + "node": ">=22.12.0", + "npm": ">=10.9.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4351,6 +4352,23 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@faker-js/faker": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.3.0.tgz", + "integrity": "sha512-r0tJ3ZOkMd9xsu3VRfqlFR6cz0V/jFYRswAIpC+m/DIfAUXq7g8N7wTAlhSANySXYGKzGryfDXwtwsY8TxEIDw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/fakerjs" + } + ], + "license": "MIT", + "engines": { + "node": ">=18.0.0", + "npm": ">=9.0.0" + } + }, "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -55105,6 +55123,7 @@ "react-transition-group": "^4.4.5" }, "devDependencies": { + "@faker-js/faker": "^9.0.3", "@types/react-is": "^17.0.3", "react-router-dom": "^6.2.1" },