Skip to content
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

Adding both working-directory and start does not work. #68

Closed
shicholas opened this issue Jan 23, 2020 · 5 comments
Closed

Adding both working-directory and start does not work. #68

shicholas opened this issue Jan 23, 2020 · 5 comments
Assignees

Comments

@shicholas
Copy link

We have a monorepo containing many repos, therefore we use the working-directory directive in many of our GitHub Actions.

This did not work:

      - name: Run integration tests with cypress.
        uses: cypress-io/github-action@master
        with:
          start: npm ./web run dev
          wait-on: http://localhost:8000
          working-directory: ./web

and errored like:

/usr/local/bin/npm run dev
waiting on "http://localhost:8000" with timeout of 60 seconds
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/runner/work/codebase/codebase/package.json
npm ERR! errno -2

but this did:

      - name: Run integration tests with cypress.
        uses: cypress-io/github-action@master
        with:
          start: npm --prefix ./web run dev
          wait-on: http://localhost:8000
          working-directory: ./web

note the --prefix command to specify the same directory as the working-directory command.

@tristanbes
Copy link

tristanbes commented Jan 23, 2020

I'm experiencing the same issue. I must run the tests from subdirectory sites/

            - name: Run Cypress
              if: startsWith(github.head_ref, 'dependabot') != true
              uses: cypress-io/github-action@v1
              with:
                  record: true
                  parallel: true
                  group: ${{ matrix.cypress.group }}
                  spec: ${{ matrix.cypress.spec }}
              working-directory: sites

It outputs:

### ERRORED 11:53:50Z

- Your workflow file was invalid: The pipeline is not valid. .github/workflows/ci.yml (Line: 333, Col: 15): Unexpected value 'working-directory',.github/workflows/ci.yml (Line: 340, Col: 15): Unexpected value 'working-directory'

@rodrigonehring
Copy link

@tristanbes "working-directory" doesn't work with "uses", must be within "with"

@bahmutov
Copy link
Contributor

@shicholas can you please describe your folder structure. Is it

root/
  .github/workflows/...
  web/
    package.json with "dev" script

and you need to run npm run dev in the web subfolder?

@shicholas
Copy link
Author

shicholas commented Jan 27, 2020 via email

@bahmutov
Copy link
Contributor

I will mark this as a duplicate of #55 which should be fixed very soon

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

4 participants