-
Notifications
You must be signed in to change notification settings - Fork 379
chore(ci): refactor CI and upgrade actions#10294
Conversation
Splits the PR preview action into two distinct actions, one to build and deploy the documentation for the PR, and another to do the CI tasks such as linting, testing and building. The latter workflow no longer requires the pull_request_target to run, which limits access to repository secrets.
These workflows are now use a composite action to take care of the repetitive task of setting up Node.js, installing dependencies and running the build. The release workflow has been converted to re-use the CI and documentation workflows to reduce duplication.
I've ran the CI on this on my fork for testing, which you can see the result of here:
Push on main
CI -- https://github.com/jonkoops/patternfly-react/actions/runs/8819259805
Release (includes docs) -- https://github.com/jonkoops/patternfly-react/actions/runs/8819259882
Pull request
CI -- https://github.com/jonkoops/patternfly-react/actions/runs/8819461879
Documentation -- https://github.com/jonkoops/patternfly-react/actions/runs/8819461789/job/24210724184
|
Preview: https://patternfly-react-pr-10294.surge.sh A11y report: https://patternfly-react-pr-10294-a11y.surge.sh |
d090156 to
d006998
Compare
| "clean:exports": "lerna run clean:exports --parallel --stream", | ||
| "generate": "yarn plop", | ||
| "lint": "node --max-old-space-size=4096 node_modules/.bin/eslint --ext js,jsx,ts,tsx --cache", | ||
| "lint": "node --max-old-space-size=4096 node_modules/.bin/eslint --ext js,jsx,ts,tsx --cache --cache-strategy content", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Git doesn't track timestamps on files for modifications, the linter cache would not work. I've set this to check the file contents instead, which is slower, but will actually hit the cache.
| const owner = process.env.CIRCLE_PROJECT_USERNAME || ghrepo.split('/')[0]; // patternfly | ||
| const repo = process.env.CIRCLE_PROJECT_REPONAME || ghrepo.split('/')[1]; | ||
| const prnum = process.env.CIRCLE_PR_NUMBER || process.env.GH_PR_NUM; | ||
| const prbranch = process.env.CIRCLE_BRANCH || process.env.GITHUB_REF.split('/').pop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle CI isn't used anymore, so I've removed references to environment variables related to it.
wise-king-sullyman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incredible
dlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks y'all! |