Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit a991e6f

Browse files
committed
fix: test workflow
1 parent c8ee9fd commit a991e6f

File tree

4 files changed

+83
-13
lines changed

4 files changed

+83
-13
lines changed

.github/workflows/storybook-tests-on-push.yml

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Storybook Tests"
1+
name: "Tests Storybook"
22
on: push
33

44
concurrency:
@@ -26,28 +26,41 @@ jobs:
2626
- name: Install dependencies
2727
run: pnpm install
2828

29-
- name: Cache Playwright browsers
29+
- name: Cache Build
30+
id: cache-build
3031
uses: actions/cache@v4
3132
with:
32-
path: ~/.cache/ms-playwright
33-
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
33+
path: dist
34+
key: ${{ runner.os }}-build-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx', '**/pnpm-lock.yaml') }} # Cache key based on OS and file hashes
3435
restore-keys: |
35-
${{ runner.os }}-playwright-
36+
${{ runner.os }}-build-
3637
37-
- name: Install Playwright
38-
run: npx playwright install --with-deps
38+
- name: Build
39+
if: steps.cache-build.outputs.cache-hit != 'true'
40+
run: pnpm build
3941

4042
- name: Cache Storybook build
4143
uses: actions/cache@v4
4244
with:
4345
path: storybook-static
44-
key: ${{ runner.os }}-storybook-${{ hashFiles('**/pnpm-lock.yaml') }}
46+
key: ${{ runner.os }}-storybook-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx', '**/pnpm-lock.yaml') }}
4547
restore-keys: |
4648
${{ runner.os }}-storybook-
4749
4850
- name: Build Storybook
4951
run: pnpm build-storybook --quiet
5052

53+
- name: Cache Playwright browsers
54+
uses: actions/cache@v4
55+
with:
56+
path: ~/.cache/ms-playwright
57+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/*.ts', '**/*.tsx', '**/*.mdx', '**/pnpm-lock.yaml') }} # Cache key based on OS and file hashes
58+
restore-keys: |
59+
${{ runner.os }}-playwright-
60+
61+
- name: Install Playwright
62+
run: npx playwright install --with-deps
63+
5164
- name: Serve Storybook and run tests
5265
run: |
5366
npx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \

lib/examples/task-list/task-list.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ export const TaskList = () => {
3434

3535
<div className="ui-flex ui-flex-col ui-rounded-md ui-bg-slate-50 ui-shadow-md dark:ui-bg-slate-800">
3636
{error ? (
37-
<div className="ui-flex ui-items-center ui-gap-2 ui-border-b ui-border-slate-200 ui-px-4 ui-py-2 last:ui-border-b-0 dark:ui-border-slate-800">
38-
<p data-testid="error-message" className="ui-text-danger-500">
39-
Error loading tasks: {error.message}
40-
</p>
37+
<div
38+
data-testid="error-message"
39+
className="ui-flex ui-items-center ui-gap-2 ui-border ui-border-danger-500 ui-px-4 ui-py-2 dark:ui-border-slate-800"
40+
>
41+
Error loading tasks: {error.message}
4142
</div>
4243
) : (
4344
tasks.map((task) => (

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "gitcoin-ui",
33
"version": "0.0.0",
44
"type": "module",
5+
"types": "./dist/index.d.ts",
56
"main": "./dist/index.umd.ts",
67
"module": "./dist/index.es.ts",
7-
"types": "./dist/index.d.ts",
88
"files": [
99
"dist"
1010
],
@@ -48,6 +48,7 @@
4848
"@vitejs/plugin-react": "^4.3.2",
4949
"@vitejs/plugin-react-swc": "^3.7.1",
5050
"autoprefixer": "^10.4.20",
51+
"axe-playwright": "^2.0.3",
5152
"chromatic": "^11.12.5",
5253
"class-variance-authority": "^0.7.0",
5354
"clsx": "^2.1.1",

pnpm-lock.yaml

+55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)