From 97f8fb5abfa772fbfef63b5adcb1cdd178e05df3 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Tue, 18 Jun 2024 12:19:59 -0500 Subject: [PATCH 1/2] Add Services compilation check Signed-off-by: Michael Tinker --- .github/workflows/validate-protobufs.yml | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/validate-protobufs.yml diff --git a/.github/workflows/validate-protobufs.yml b/.github/workflows/validate-protobufs.yml new file mode 100644 index 00000000..8d83248a --- /dev/null +++ b/.github/workflows/validate-protobufs.yml @@ -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 + + - name: Run Gradle assemble + run: ./gradlew assemble + working-directory: hedera-services From 167a612fbc66085b82830687522f9b0bbde905c1 Mon Sep 17 00:00:00 2001 From: Michael Tinker Date: Tue, 18 Jun 2024 12:52:50 -0500 Subject: [PATCH 2/2] Use more flexible sed command Signed-off-by: Michael Tinker --- .github/workflows/validate-protobufs.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/validate-protobufs.yml b/.github/workflows/validate-protobufs.yml index 8d83248a..0083cf53 100644 --- a/.github/workflows/validate-protobufs.yml +++ b/.github/workflows/validate-protobufs.yml @@ -10,10 +10,6 @@ jobs: 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: @@ -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 - name: Run Gradle assemble run: ./gradlew assemble