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

feat: allow multiple build commands #408

Closed

Conversation

Bickio
Copy link

@Bickio Bickio commented Aug 3, 2021

This functionality was already available for the start option. This PR adds it for the build option as well.

@CLAassistant
Copy link

CLAassistant commented Aug 3, 2021

CLA assistant check
All committers have signed the CLA.

@Bickio Bickio force-pushed the allow-multiple-build-commands branch from 3946c5b to 3d8b2a6 Compare August 3, 2021 11:20
@karlhorky
Copy link
Contributor

@Bickio until this is merged, how are you getting around this?

@Bickio
Copy link
Author

Bickio commented Aug 4, 2021

@karlhorky I created separate action steps to npm install and run both build commands, instead of using the built-in options. It works fine, but it's not particularly clean.

@karlhorky
Copy link
Contributor

karlhorky commented Aug 4, 2021

Nice, what I ended up doing was creating a new npm script called prepare-for-cypress-tests, where I can run multiple commands:

package.json:

{
  "scripts": {
    "prepare-for-cypress-tests": "yarn copy-default-env && yarn migrate up && yarn sync-fixtures-to-db"
  }
}

@MikeMcC399
Copy link
Collaborator

This PR from 2021 is incomplete in a couple of aspects:

  • It fails CI tests since the npm run build step has not been executed in the commit. See the CONTRIBUTING guide for details about the HUSKY hook and manually running these steps
  • The new functionality has not been added to the example tests.

@Bickio
Copy link
Author

Bickio commented Nov 18, 2023

In the 2.5 years since this PR was opened, I switched all my projects to playwright. Someone else is welcome to tidy this up if they want it merged, but I don't intend to do so myself.

@MikeMcC399
Copy link
Collaborator

@Bickio

Many thanks for your feedback!

It's completely understandable if your situation has changed after such a lapse of time. Perhaps, as you suggest, somebody else may like to pick this up?

@MikeMcC399
Copy link
Collaborator

Another workaround would be to use the Split install and tests method. Using the example from @karlhorky above ^^, it might look something like this:

name: E2E
on: push
jobs:
  test:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - name: Install dependencies
        uses: cypress-io/github-action@v6
        with:
          # just perform install
          runTests: false
      - run: yarn copy-default-env
      - run: yarn migrate up
      - run: yarn sync-fixtures-to-db"
      - name: Run e2e tests
        uses: cypress-io/github-action@v6
        with:
          # we have already installed all dependencies above
          install: false
          # Cypress tests and config file are in "e2e" folder
          working-directory: e2e

@MikeMcC399
Copy link
Collaborator

@Bickio

Since this PR is incomplete and therefore cannot be merged in its current state, and because you said that you won't be working on it any further, I'm going to close it.

It could be re-opened if there are any volunteers to pick it up.

@MikeMcC399 MikeMcC399 closed this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants