Skip to content

Commit b831a84

Browse files
authored
Merge pull request #281 from qwikifiers/storybook-ci
2 parents 3cc7c96 + ac739cf commit b831a84

File tree

6 files changed

+571
-15
lines changed

6 files changed

+571
-15
lines changed

.github/actions/test/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ inputs:
66
github_token:
77
description: GitHub token
88
required: true
9+
chromatic_token:
10+
description: Chromatic token
11+
required: true
912

1013
runs:
1114
using: composite
@@ -23,6 +26,19 @@ runs:
2326
shell: bash
2427
run: npx nx build headless
2528

29+
- name: Build storybook
30+
shell: bash
31+
run: npx nx build-storybook headless
32+
33+
- name: Publish to Chromatic
34+
uses: chromaui/action@v1
35+
# Chromatic GitHub Action options
36+
with:
37+
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
38+
projectToken: ${{ inputs.chromatic_token }}
39+
storybookBuildDir: dist/storybook/headless
40+
zip: true
41+
2642
# - name: Build Tailwind Theme
2743
# shell: bash
2844
# run: npx nx build tailwind

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ jobs:
2828
uses: ./.github/actions/test
2929
with:
3030
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
chromatic_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"commit": "git-cz",
1212
"format:fix": "pretty-quick --staged",
1313
"prepare": "husky install",
14-
"test:headless": "nx component-test headless --watch"
14+
"test:headless": "nx component-test headless --watch",
15+
"story:headless": "nx build-storybook headless"
1516
},
1617
"devDependencies": {
1718
"@builder.io/qwik": "1.0.0",
@@ -50,6 +51,7 @@
5051
"all-contributors-cli": "^6.24.0",
5152
"autoprefixer": "^10.4.13",
5253
"axe-core": "4.6.3",
54+
"chromatic": "6.17.3",
5355
"commitizen": "^4.3.0",
5456
"commitlint": "^17.4.3",
5557
"country-list-json": "1.1.0",

packages/kit-headless/package.json

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,7 @@
2020
"node": ">=16.0.0"
2121
},
2222
"private": false,
23-
"scripts": {
24-
"build": "qwik build",
25-
"build.lib": "vite build --mode lib",
26-
"build.types": "tsc --emitDeclarationOnly",
27-
"dev": "vite --mode ssr",
28-
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
29-
"fmt": "prettier --write .",
30-
"fmt.check": "prettier --check .",
31-
"release": "np",
32-
"start": "vite --open --mode ssr",
33-
"qwik": "qwik",
34-
"storybook1": "storybook dev -p 6006",
35-
"build-storybook1": "storybook build"
36-
},
23+
"scripts": {},
3724
"dependencies": {
3825
"@floating-ui/dom": "1.0.10"
3926
}

packages/kit-headless/project.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@
9494
}
9595
}
9696
},
97+
"test-storybook": {
98+
"executor": "nx:run-commands",
99+
"options": {
100+
"command": "pnpm test-storybook --url http://localhost:4400",
101+
"cwd": "packages/headless"
102+
}
103+
},
97104
"component-test": {
98105
"executor": "@nx/cypress:cypress",
99106
"options": {

0 commit comments

Comments
 (0)