Skip to content

Yarn Berry Support on GitHub Actions #443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hwookim opened this issue Oct 31, 2021 · 2 comments
Closed

Yarn Berry Support on GitHub Actions #443

hwookim opened this issue Oct 31, 2021 · 2 comments

Comments

@hwookim
Copy link

hwookim commented Oct 31, 2021

I saw the #166 issue and the 6.0.2 version of the release note, but I don't know what to do.

https://github.com/CrossroadsCX/action/blob/afe74f34a1608ecb8571b65163a7695ecf1af0d4/README.md#yarn-2-support
It's solved in this way...
Is it a way to allow node_modules only for a moment?
Did I not find the right way?

If possible, I want to see an example.


I'm trying like this.

name: "Chromatic Deployment"

on:
  pull_request:
    paths:
      - client/**
    branches:
      - '**'

jobs:
  deploy-chromatic:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./client

    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Install dependencies
        run: yarn

      - name: Publish to Chromatic
        uses: chromaui/action@v1
        with:
          projectToken: ${{ secrets.CHROMATIC_TOKEN }}
          token: ${{ secrets.GITHUB_TOKEN }}
          workingDir: client

The error is like this.

Chromatic CLI v6.0.5
https://www.chromatic.com/docs/cli

Authenticating with Chromatic
    → Connecting to https://index.chromatic.com
Authenticated with Chromatic
    → Using project token '********ed41'
Retrieving git information
Retrieved git information
    → Commit 'd91d176' on branch 'TP-36'; found 1 parent commit
Collecting Storybook metadata
Collected Storybook metadata
    → ; no supported addons found
Building your Storybook
    → Running command: npm run --silent build:storybook -- --output-dir /tmp/chromatic--1658-T1kaYVKMlYD4
The CLI tried to run your build:storybook script, but the command failed. This indicates a problem with your Storybook. Here's what to do:

- Check the Storybook build log printed below.
- Run npm run build:storybook or yarn build:storybook yourself and make sure it outputs a valid Storybook by opening the generated index.html in your browser.
    → Command failed: npm run --silent build:storybook -- --output-dir /tmp/chromatic--1658-T1kaYVKMlYD4

- Review the build-storybook CLI options at https://storybook.js.org/docs/configurations/cli-options/#for-build-storybook

Command failed with exit code 1: npm run --silent build:storybook -- --output-dir /tmp/chromatic--1658-T1kaYVKMlYD4

ℹ Spawn settings:
{
  "client": "npm",
  "clientVersion": "6.14.15",
  "nodeVersion": "v14.18.1",
  "platform": "linux",
  "command": "npm",
  "clientArgs": [
    "run",
    "--silent"
  ],
  "scriptArgs": [
    "build:storybook",
    "--",
    "--output-dir",
    "/tmp/chromatic--1658-T1kaYVKMlYD4"
  ]
}

ℹ Storybook build output:
/home/runner/work/TILBox/TILBox/client/build-storybook.log

sh: 1: build-storybook: not found



Error: non-zero exit code

I'm on
chromatic 6.0.5
storybook/react 6.3.12

@cmbirk
Copy link

cmbirk commented Nov 16, 2021

Yes, that basically sets the nodeLinker mentioned in the yarn berry docs to use node-modules just for your CI action. It changes the configuration before running yarn install so that the packages are build in the old node-modules folder location where chromatic can find them

@Axedyson
Copy link

@hwookim. Take a look at the two last comments in this thread. I think those comments could help you, because it helped me fix it. The docs could be a lot clearer about this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants