-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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: run GHA build job locally with act #23959
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,16 +47,21 @@ runs: | |
(steps.node-modules-restore.outputs.cache-hit == 'true') && 'true' || '' | ||
}}' >> "$GITHUB_ENV" | ||
|
||
- name: Enable corepack | ||
shell: bash | ||
run: corepack enable | ||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 8.6.12 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: ${{ env.CACHE_HIT != 'true' && 'pnpm' || '' }} | ||
|
||
- name: Enable corepack | ||
shell: bash | ||
run: corepack enable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will probably not work when there is a pnpm in place |
||
|
||
- name: Install dependencies | ||
uses: nick-fields/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0 | ||
if: env.CACHE_HIT != 'true' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -471,6 +471,7 @@ jobs: | |
|
||
- name: Upload | ||
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | ||
if: ${{ !env.ACT }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This step should not be enabled when running the pipeline with act |
||
with: | ||
name: renovate-package | ||
path: renovate-0.0.0-semantic-release.tgz | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,15 @@ Then you can run `pnpm` directly from Docker, for instance: | |
docker run -it --rm -v "$PWD":/usr/src/app -w /usr/src/app renovatebot_local pnpm install | ||
``` | ||
|
||
## Run GitHub Action build job locally with act | ||
|
||
1. Install act - [installation instructions](https://github.com/nektos/act#installation) | ||
1. Run (Pick the Large image) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need the large image? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't remember now why the large image is required. I do remember that the smaller image doesn't work. |
||
|
||
``` | ||
act -W .github/workflows/build.yml -j build | ||
``` | ||
|
||
## Fork and Clone | ||
|
||
If you want to contribute to the project, you should first "fork" the main project using the GitHub website and then clone your fork locally. | ||
|
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.
why this is required?
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.
Setup node uses pnpm but the corepack is not enabled yet so the binary is missing.
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.
then enable corepack instead
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.
It is installed with the node setup
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.
sure, but corepack is also available if nodejs is already available
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.
Do we want to merge this before then? That PR is conflicted and waiting for someone to resume it and then hopefully the maintainers to merge it
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.
I do think it has value in merging it. Waiting for a general approval and then I'll rebase.
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.
We'll need a regex manager added to keep it updated though. It's already out of date :)
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.
Done
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.
I would prefer to leave the corepack enable when not on act. maybe we should build our own act image to not need the huge default act image.