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

CI: Autobuild job #2747

Open
szepeviktor opened this issue Jan 30, 2021 · 7 comments
Open

CI: Autobuild job #2747

szepeviktor opened this issue Jan 30, 2021 · 7 comments

Comments

@szepeviktor
Copy link

Motivation
When editing files here on GitHub one cannot run npm run build

Description
Please consider adding a CI job:

  1. runs npm run build
  2. commit the changes
@mAAdhaTTah
Copy link
Member

The repo code powers download page of the website, which is served from github pages & uses the minified files in the repo, so we need to commit the built files so it works.

@szepeviktor
Copy link
Author

szepeviktor commented Jan 30, 2021

@mAAdhaTTah That is what I'm suggesting! :)

  1. User comes and edits a file here on GitHub web interface
  2. CI auto-builds all those minified files and commits to the repo

@mAAdhaTTah mAAdhaTTah reopened this Jan 30, 2021
@mAAdhaTTah
Copy link
Member

Oh, hmm, I suspect it would only work if the author gives us editing rights. Interesting idea tho so I'll keep this open.

@szepeviktor
Copy link
Author

PrismJS/prism has write access to PR branches!

@RunDevelopment
Copy link
Member

PrismJS/prism has write access to PR branches!

Only if they don't deselect the "Allow edits from maintainers" option. It's on by default tho.

This actually has the nice side effect that users can actually opt-out of this feature, if implemented.

CI auto-builds all those minified files and commits to the repo

GitHub action workflows that commit code won't trigger the CI again. This is an explicit feature of GH actions.

This behavior isn't a problem for the test suite (it doesn't use minified files) but it is a problem for the bundle size bot. The bot itself can't build the PR branch since that means executing untrusted code. (The bot runs in pull_request_target scope, so it has full access to this repo.)

@szepeviktor
Copy link
Author

Currently in the final CI step exit 1 makes the whole thing fail 🌧️
https://github.com/PrismJS/prism/blob/master/.github/workflows/test.yml#L43-L46

Instead we could commit those files.

Side-effect: node-version: [10.x, 12.x, 14.x] should run after each other to allow this procedure.

  1. run on nodejs 14
  2. check and optionally commit to the repo
  3. run on nodejs 12 and 10

@RunDevelopment
Copy link
Member

We could also ditch the older node versions. This has the disadvantage that version-specific bugs in node causing different build results might go undetected but it's a lot simpler.

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

No branches or pull requests

3 participants