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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/validate-protobufs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Validate Protobufs Compilation

on:
pull_request:
branches:
- main

jobs:
validate-protobufs:
runs-on: ubuntu-latest

steps:
- name: Get PR branch name
id: pr_branch
run: echo "branch=${GITHUB_HEAD_REF}" >> $GITHUB_ENV

- name: Checkout hedera-services
uses: actions/checkout@v3
with:
repository: hashgraph/hedera-services
path: hedera-services

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


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

working-directory: hedera-services