From 431d690b7d28f2216d2e8e380705852d3d101775 Mon Sep 17 00:00:00 2001 From: kotharironak <53209990+kotharironak@users.noreply.github.com> Date: Mon, 22 Nov 2021 22:11:03 +0530 Subject: [PATCH] refactor: moving out avro checks as a separate job (#289) * refactor: moving out avro checks as a seperate job * reverting back to pull_request_target * revert back space too * adds caching layer for avroCompatibilityCheck --- .github/workflows/pr-build.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index bef81c3fe..1104f43b9 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -4,7 +4,7 @@ on: branches: - main pull_request_target: - branches: + branches: - main jobs: @@ -40,7 +40,7 @@ jobs: - name: Build with Gradle uses: hypertrace/github-actions/gradle@main with: - args: build dockerBuildImages + args: build -x avroCompatibilityCheck dockerBuildImages validate-helm-charts: runs-on: ubuntu-20.04 @@ -78,3 +78,31 @@ jobs: env: SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} GRADLE_OPTS: -Dorg.gradle.workers.max=1 + + validate-avros: + runs-on: ubuntu-20.04 + steps: + # Set fetch-depth: 0 to fetch commit history and tags for use in version calculation + - name: Check out code + uses: actions/checkout@v2.3.4 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + fetch-depth: 0 + + - name: create checksum file + uses: hypertrace/github-actions/checksum@main + + - name: Cache packages + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-packages-${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/checksum.txt') }} + restore-keys: | + gradle-packages-${{ runner.os }}-${{ github.job }} + gradle-packages-${{ runner.os }} + + - name: validate avros + uses: hypertrace/github-actions/gradle@main + with: + args: avroCompatibilityCheck