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

feat: run GHA build job locally with act #23959

Closed
wants to merge 1 commit into from

Conversation

lmilbaum
Copy link
Contributor

@lmilbaum lmilbaum commented Aug 20, 2023

Changes

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@lmilbaum lmilbaum marked this pull request as draft August 20, 2023 06:30
@lmilbaum lmilbaum force-pushed the build branch 2 times, most recently from dd0602b to 98487fc Compare August 20, 2023 06:31
@lmilbaum lmilbaum changed the title Build renovate image with make feat: Build renovate image with make Aug 20, 2023
@rarkins
Copy link
Collaborator

rarkins commented Aug 21, 2023

I usually use Makefiles although left it out of this project due to the number of Windows users. We face this challenge:

  • If we put anything in the Makefile which can't be done otherwise, we might accidentally have a project which is hostile to Windows contributors
  • If everything in the Makefile maps to pnpm ... then we are adding this file just to save 5 characters for each command

So @lmilbaum is there any strong benefit from this?

@lmilbaum lmilbaum force-pushed the build branch 2 times, most recently from 6bee32f to c135ef8 Compare August 21, 2023 17:37
@lmilbaum
Copy link
Contributor Author

@rarkins Thank you for your feedback. I'm testing something with the PR. It is in draft. Can we review its value or/and alternative options in a later stage?

@lmilbaum lmilbaum force-pushed the build branch 7 times, most recently from 0937501 to d583fb7 Compare August 25, 2023 14:55
@lmilbaum lmilbaum changed the title feat: Build renovate image with make feat: run GHA build job locally with act Aug 25, 2023
@lmilbaum lmilbaum force-pushed the build branch 3 times, most recently from a2ffb29 to 532dc83 Compare August 25, 2023 15:10
@lmilbaum lmilbaum marked this pull request as ready for review August 25, 2023 15:11
Comment on lines +50 to +52
- name: Install pnpm
uses: pnpm/action-setup@v2.4.0
with:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is required?

Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then enable corepack instead

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

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.

@lmilbaum
Copy link
Contributor Author

@viceice ping

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add regex manager for updating pnpm version in action

@@ -462,6 +462,7 @@ jobs:

- name: Upload
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: ${{ !env.ACT }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step should not be enabled when running the pipeline with act

Comment on lines +50 to +52
- name: Install pnpm
uses: pnpm/action-setup@v2.4.0
with:
Copy link
Member

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.


- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will probably not work when there is a pnpm in place

## 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need the large image?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rarkins
Copy link
Collaborator

rarkins commented Feb 18, 2024

Can this be moved forward to merging or should it be closed?

@lmilbaum
Copy link
Contributor Author

Can this be moved forward to merging or should it be closed?

Thanks @rarkins for reminding me of this PR. Closing.

@lmilbaum lmilbaum closed this Feb 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants