From dada47cb060501981ba5fcc8037aa04f4fd7fe63 Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 22 Nov 2021 12:50:48 +0530 Subject: [PATCH 1/4] refactor: moving out avro checks as a seperate job --- .github/workflows/pr-build.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index bef81c3fe..308e9e437 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -3,8 +3,8 @@ on: push: branches: - main - pull_request_target: - branches: + pull_request: + 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,20 @@ 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: validate avros + uses: hypertrace/github-actions/gradle@main + with: + args: avroCompatibilityCheck + From 93812e6970ea4f08044c64576376bfefb468bb9a Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 22 Nov 2021 12:54:38 +0530 Subject: [PATCH 2/4] reverting back to pull_request_target --- .github/workflows/pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index 308e9e437..da2385fae 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -3,7 +3,7 @@ on: push: branches: - main - pull_request: + pull_request_target: branches: - main From 385a17b78f7e419e6d451dc630bd4a46877a2342 Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 22 Nov 2021 12:58:25 +0530 Subject: [PATCH 3/4] revert back space too --- .github/workflows/pr-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index da2385fae..a412e1f20 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: From 31b6458c4378dce1425693ea22fdb169d7cf4bac Mon Sep 17 00:00:00 2001 From: Ronak Date: Mon, 22 Nov 2021 20:59:36 +0530 Subject: [PATCH 4/4] adds caching layer for avroCompatibilityCheck --- .github/workflows/pr-build.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index a412e1f20..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: @@ -90,8 +90,19 @@ jobs: repository: ${{github.event.pull_request.head.repo.full_name}} fetch-depth: 0 - - name: validate avros - uses: hypertrace/github-actions/gradle@main - with: - args: avroCompatibilityCheck + - 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