Skip to content

feat: add Services compilation check#376

Open
tinker-michaelj wants to merge 2 commits intomainfrom
validate-compilation
Open

feat: add Services compilation check#376
tinker-michaelj wants to merge 2 commits intomainfrom
validate-compilation

Conversation

@tinker-michaelj
Copy link
Copy Markdown
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 <michael.tinker@swirldslabs.com>
@tinker-michaelj tinker-michaelj requested a review from a team as a code owner June 18, 2024 17:20

- name: Update hedera-services branch
run: |
sed -i 's/branch = "main"/branch = "${{ env.branch }}"/' hedera-services/hapi/build.gradle.kts
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <michael.tinker@swirldslabs.com>
- 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
Copy Markdown
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
Copy Markdown
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

@jsync-swirlds
Copy link
Copy Markdown
Member

@tinker-michaelj Is this PR still active and relevant?

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