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: add Services compilation check #376

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tinker-michaelj
Copy link
Contributor

Description:

  • Adds a GH action to validate Services will still compile with the protobufs on a PR to main.

Signed-off-by: Michael Tinker <[email protected]>

- name: Update hedera-services branch
run: |
sed -i 's/branch = "main"/branch = "${{ env.branch }}"/' hedera-services/hapi/build.gradle.kts
Copy link
Member

Choose a reason for hiding this comment

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

This might have issues with the occasional branch modification. Here's a possible fix:

Suggested change
sed -i 's/branch = "main"/branch = "${{ env.branch }}"/' hedera-services/hapi/build.gradle.kts
sed -i 's/branch = "[a-zA-Z\-\/0-9]+"/branch = "${{ env.branch }}"/' hedera-services/hapi/build.gradle.kts

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. We might not have main as branch name always in services.

sed -i 's/branch = "main"/branch = "${{ env.branch }}"/' hedera-services/hapi/build.gradle.kts

- name: Run Gradle assemble
run: ./gradlew assemble
Copy link
Member

Choose a reason for hiding this comment

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

This may be OK, but we might need to add the cgroup controls Nathan worked out for services to make sure the compile doesn't starve out the github agent on the runner.
Something to watch for.

Signed-off-by: Michael Tinker <[email protected]>
@@ -22,7 +18,7 @@ jobs:

- name: Update hedera-services branch
run: |
sed -i 's/branch = "main"/branch = "${{ env.branch }}"/' hedera-services/hapi/build.gradle.kts
sed -i.bak "s/branch = \".*\"/branch = \"${GITHUB_HEAD_REF}\"/" hedera-services/hapi/build.gradle.kts
Copy link
Member

Choose a reason for hiding this comment

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

Something worth noting:
Sed is greedy by default, so this might match a lot more than we want, basically it will extend as far as it can without crossing to a new line. That shouldn't be an issue, unless someone puts a comment at end of line with a " in it, in which case this may break (that's why I restricted the match set in my suggestion).

Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @tinker-michaelj

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

Successfully merging this pull request may close these issues.

3 participants