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

[Feature request] Add support for Bun

Open Kocal opened this issue 2 years ago • 13 comments

Just opening a feature request for Bun support. It implies:

  • support for install deps command
  • support for deps caching

I may open a new PR soon, if I find that Bun really improves performances on our project.

Kocal avatar Jul 23 '22 16:07 Kocal

Any updates Bun 1.0 (prod ready) is out, this is a must nowadays

h2oearth avatar Sep 14 '23 03:09 h2oearth

Any updates here?

lundjrl avatar Sep 30 '23 19:09 lundjrl

If somebody wants to use Bun with GitHub Actions, they can use the workflow .github/workflows/single.yml from the demo repo cypress-io/cypress-example-kitchensink as a template (which does not rely on cypress-io/github-action).

  1. Replace actions/setup-node by npm install -g bun
  2. Change the cache lockfile from package-lock.json to bun.lockb
  3. Add a new cache for ~/.bun
  4. Replace npx calls with bun calls

bun install cypress does not run the postinstall script, so you would also need to run bun cypress install manually.

I haven't seen any feedback from the Cypress team how they see Bun and I don't see any official support from Cypress for Bun either, so I would be cautious about using this in production however.

MikeMcC399 avatar Oct 02 '23 12:10 MikeMcC399

In order for Bun to be integrated into cypress-io/github-action I would expect the following checklist items to all be checked off. The community could ignore the checklist and submit a PR and the Cypress team could decide to accept it. (I don't get to take this decision. It's just my opinion.)

OS Support

  • [X] Ubuntu
  • [x] Windows native (not WSL2)
  • [X] macOS

Node.js

  • [ ] Full implementation of Node.js API by Bun

GitHub Actions Support

Cypress Support

MikeMcC399 avatar Oct 02 '23 15:10 MikeMcC399

If somebody wants to use Bun with GitHub Actions, they can use the workflow .github/workflows/single.yml from the demo repo cypress-io/cypress-example-kitchensink as a template (which does not rely on cypress-io/github-action).

  1. Replace actions/setup-node@v3 by npm install -g bun
  2. Change the cache lockfile from package-lock.json to bun.lockb
  3. Add a new cache for ~/.bun
  4. Replace npx calls with bun calls

bun install cypress does not run the postinstall script, so you would also need to run bun cypress install manually.

I haven't seen any feedback from the Cypress team how they see Bun and I don't see any official support from Cypress for Bun either, so I would be cautious about using this in production however.

@MikeMcC399 Thank you for this, I greatly appreciate it!

lundjrl avatar Oct 02 '23 17:10 lundjrl

@MikeMcC399 Yeah, it seems a little early for full Bun support. I guess I was under the impression that the infra behind Github Actions already supported it and Cypress was playing catch-up. I think it makes sense (if Cypress cares) to add an experimental Cypress Bun image but should in no way be ready for production with Windows support from the core bun team being so far behind.

lundjrl avatar Oct 02 '23 17:10 lundjrl

IMO Bun is here to stay and some of us are using it, and will be nice if Cypress follow :-)

h2oearth avatar Oct 03 '23 02:10 h2oearth

@h2oearth

IMO Bun is here to stay and some of us are using it, and will be nice if Cypress follow :-)

You should consider opening a feature request against Cypress on its issue list. Apparently nobody has made this suggestion so far.

The feature request here is for support of Bun by cypress-io/github-action which is only a small part of what would have to be done.

MikeMcC399 avatar Oct 03 '23 05:10 MikeMcC399

Will do @MikeMcC399 , cheers

h2oearth avatar Oct 03 '23 05:10 h2oearth

@h2oearth can you refer to the feature request created - as would also like to see Cypress support bun - especially including a version in Docker that supports it - I am looking at migrating an app that uses to Cypress from npm to bun - as this may be a blocker.

MarkAPhillips avatar Jan 08 '24 14:01 MarkAPhillips

@MarkAPhillips

I cannot see any feature request for Bun in the

so if you decided to submit a request yourself, you would not be duplicating any existing request.

MikeMcC399 avatar Jan 10 '24 12:01 MikeMcC399

  • There is a compatibility issue between Bun 1.0.25 and Cypress 13.6.4 in that Bun fails to complete the Cypress postinstall script (effectively bun cypress install) if Node.js is not installed (see issue https://github.com/oven-sh/bun/issues/8658). This is not noticeable in a GitHub Actions environment because all GitHub Actions Runner Images have Node.js installed. The Cypress GitHub Action cypress-io/github-action entirely relies on Node.js, therefore it is not an issue with this action at this time, and for the foreseeable future.

MikeMcC399 avatar Feb 03 '24 10:02 MikeMcC399

  • There still has not been any clean, simple request to the cypress issue list for Cypress to officially support Bun. This would need to come from somebody who wants it. Resolution of https://github.com/oven-sh/bun/issues/8658 by Bun would be a prerequisite, I imagine.

MikeMcC399 avatar Feb 03 '24 10:02 MikeMcC399

  • Closing this feature request in favor of https://github.com/cypress-io/cypress/issues/28962. Please follow development in this main feature request.

MikeMcC399 avatar Mar 26 '24 09:03 MikeMcC399