Monorepo support
See original GitHub issueBy @isaac-martin in https://github.com/chromaui/action/issues/30:
Would love an option on this action to run the job inside a certain directory.
defaults:
run:
working-directory: web
We have a mono repo with the below dir structure
cms
web
.storybook
Github actions need to live in the root - so currently we cant use this action and have to manually run chromatic using the script in our package.json
I can implement this change if someone can point me in the right direction.
By wendylw in https://github.com/chromaui/action/issues/61:
# This is a basic workflow to help you get started with Actions
name: Chromatic
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: master
defaults:
run:
working-directory: frontend
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
env:
EXTEND_ESLINT: true
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Required to retrieve git history
- run: |
EXTEND_ESLINT=true yarn && yarn build-storybook
- uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: ./storybook-static
Error: The "path" argument must be one of type string, Buffer, or URL. Received type object
Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be one of type string, Buffer, or URL. Received type object
at readFile (fs.js:295:10)
at go$readFile (/home/runner/work/_actions/chromaui/action/v1/node_modules/graceful-fs/graceful-fs.js:118:14)
at readFile (/home/runner/work/_actions/chromaui/action/v1/node_modules/graceful-fs/graceful-fs.js:115:12)
at /home/runner/work/_actions/chromaui/action/v1/node_modules/universalify/index.js:8:12
at new Promise (<anonymous>)
at readFile (/home/runner/work/_actions/chromaui/action/v1/node_modules/universalify/index.js:7:14)
at Object._readFile (/home/runner/work/_actions/chromaui/action/v1/node_modules/jsonfile/index.js:19:58)
at Object._readFile [as readFile] (/home/runner/work/_actions/chromaui/action/v1/node_modules/universalify/index.js:20:45)
at runChromatic (/home/runner/work/_actions/chromaui/action/v1/lib/main.js:66:42)
at async Promise.all (index 0)
Error: The "path" argument must be one of type string, Buffer, or URL. Received type object
Also requested by another customer.
┆Issue is synchronized with this Asana task by Unito
Issue Analytics
- State:
- Created 3 years ago
- Reactions:19
- Comments:11
Top Results From Across the Web
What is monorepo? (and should you use it?) - Semaphore CI
A monorepo is a version-controlled code repository that holds many projects. While these projects may be related, they are often logically ...
Read more >Monorepo Explained
Gradle Build Tool provides support for parallel tasks via configuration, and task orchestration through its flexible Groovy or Kotlin DSL. natively supported ......
Read more >Monorepos in Git | Atlassian Git Tutorial
A monorepo is a repository that contains more than one logical project. Read here to learn about conceptual challenges, performance issues and more....
Read more >Monorepo Support | Render · Cloud Hosting for Developers
Monorepo Support helps you deploy just the services you need to eliminate unnecessary deploys, control build costs, and ship faster. Monorepo Support offers...
Read more >A Guide to Monorepos for Front-end Code - Toptal
A monorepo or monorepository is a code management and architectural concept whereby you keep all your isolated bits of code inside one super...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I know this is an old issue, but personally it took a lot of trial and error before I got this working for me
I’ll put my learnings here - maybe it’ll help someone else 😃
I have a Drupal (CMS), with a theme folder where I had my package.json and .storybook (among other things) It lived in
web/themes/custom/MYTHEME
I quickly found out that I had to move package.json out in the root of the git, or Chromatic would never work. Sigh.
In my
package.json
I could however do this:So far so good!
Now for the Github Action:
Thank you all for your examples 😃 I would never have figured this out without this thread.
Actually I implemented this on forked repo within the feature branch but to be honest I couldn’t have spare time to follow contribution guidelines and open a PR after doing those and probably I won’t have time to do that in near future.
Anyone can do these steps is more than welcome 😄
Here you can find the changes I did. Btw it works as expected.
https://github.com/chromaui/chromatic-cli/compare/next...yigityuce:feature/action-input-workingdir