github-action icon indicating copy to clipboard operation
github-action copied to clipboard

feat: allow multiple build commands

Open Bickio opened this issue 3 years ago • 4 comments

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

Bickio avatar Aug 03 '21 11:08 Bickio

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Aug 03 '21 11:08 CLAassistant

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

karlhorky avatar Aug 04 '21 13:08 karlhorky

@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.

Bickio avatar Aug 04 '21 13:08 Bickio

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"
  }
}

karlhorky avatar Aug 04 '21 13:08 karlhorky

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.

MikeMcC399 avatar Nov 18 '23 06:11 MikeMcC399

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.

Bickio avatar Nov 18 '23 07:11 Bickio

@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 avatar Nov 18 '23 09:11 MikeMcC399

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 avatar Nov 18 '23 09:11 MikeMcC399

@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 avatar Nov 21 '23 00:11 MikeMcC399