Skip to content

Commit 56d8621

Browse files
authored
Move build chromatic to build-node action
1 parent 9eeff55 commit 56d8621

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

.github/actions/build-node/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ inputs:
3333
run_webpack:
3434
default: false
3535
required: false
36+
chromatic_enable:
37+
description: 'Enable Chromatic tests'
38+
required: false
39+
type: boolean
40+
default: false
41+
chromatic_project_token:
42+
description: 'Chromatic project token'
43+
required: false
3644

3745
runs:
3846
using: "composite"
@@ -107,3 +115,9 @@ runs:
107115
with:
108116
name: node-bundle
109117
path: ./bundles
118+
- name: Run Chromatic
119+
if: ${{ inputs.chromatic_enable }}
120+
uses: chromaui/[email protected]
121+
with:
122+
projectToken: ${{ inputs.chromatic_project_token }}
123+

.github/workflows/build-node-python.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ on:
7272
description: Unique id per workflow run. Must be set to unique value if dispatched multiple times for a single workflow.
7373
default: ""
7474
chromatic_enable:
75-
description: 'Enable Chromatic Tests'
75+
description: 'Enable Chromatic tests'
7676
required: false
7777
type: boolean
7878
default: false
@@ -137,11 +137,8 @@ jobs:
137137
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
138138
run_webpack: ${{ inputs.node_run_webpack }}
139139
enable_cache: ${{ inputs.runs_on != 'self-hosted' }}
140-
- name: Run Chromatic
141-
if: ${{ inputs.chromatic_enable }}
142-
uses: chromaui/[email protected]
143-
with:
144-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
140+
chromatic_enable: ${{ inputs.chromatic_enable }}
141+
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
145142

146143
build-python:
147144
name: Python
@@ -219,6 +216,7 @@ jobs:
219216
with:
220217
ref: ${{ inputs.branch }}
221218
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
219+
fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }}
222220
- name: Checkout github-workflows
223221
uses: actions/checkout@v4
224222
with:
@@ -233,6 +231,8 @@ jobs:
233231
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
234232
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
235233
enable_cache: ${{ inputs.cypress_runs_on != 'self-hosted' && inputs.runs_on != 'self-hosted' }}
234+
chromatic_enable: ${{ inputs.chromatic_enable }}
235+
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
236236
- name: Build python
237237
uses: ./tmp/github-workflows/.github/actions/build-python
238238
with:
@@ -338,6 +338,7 @@ jobs:
338338
with:
339339
ref: ${{ inputs.branch }}
340340
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
341+
fetch-depth: ${{ inputs.chromatic_enable && '0' || '1' }}
341342
- name: Checkout github-workflows
342343
uses: actions/checkout@v4
343344
with:
@@ -352,6 +353,8 @@ jobs:
352353
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
353354
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
354355
enable_cache: ${{ inputs.playwright_runs_on != 'self-hosted' && inputs.runs_on != 'self-hosted' }}
356+
chromatic_enable: ${{ inputs.chromatic_enable }}
357+
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
355358
- name: Build python
356359
uses: ./tmp/github-workflows/.github/actions/build-python
357360
with:

.github/workflows/build-node.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
required: false
99
default: ${{ github.ref || github.head_ref }}
1010
chromatic_enable:
11-
description: 'Enable Chromatic Tests'
11+
description: 'Enable Chromatic tests'
1212
required: false
1313
type: boolean
1414
default: false
@@ -26,6 +26,8 @@ on:
2626
required: false
2727
NODE_VERSION:
2828
required: false
29+
CHROMATIC_PROJECT_TOKEN:
30+
required: false
2931

3032
env:
3133
NPM_REGISTRY: "https://registry.npmjs.org/"
@@ -70,8 +72,5 @@ jobs:
7072
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
7173
run_webpack: ${{ inputs.node_run_webpack }}
7274
enable_cache: ${{ inputs.runs_on != 'self-hosted' }}
73-
- name: Run Chromatic
74-
if: ${{ inputs.chromatic_enable }}
75-
uses: chromaui/[email protected]
76-
with:
77-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
75+
chromatic_enable: ${{ inputs.chromatic_enable }}
76+
chromatic_project_token: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

0 commit comments

Comments
 (0)