From 4b076d057b67da2500f6e0064e738ffdc4d45da6 Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Tue, 7 Jun 2022 11:46:45 -0700 Subject: [PATCH 1/5] Infra - Fix API compatibility Github Action --- .github/workflows/api-binary-compatibility.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/api-binary-compatibility.yml b/.github/workflows/api-binary-compatibility.yml index bf89abdfaca9..d317a145ddfa 100644 --- a/.github/workflows/api-binary-compatibility.yml +++ b/.github/workflows/api-binary-compatibility.yml @@ -38,15 +38,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + if: github.event_name == 'pull_request' + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.ref }} + - uses: actions/checkout@v2 + if: github.event_name == 'push' + with: + fetch-depth: 0 - uses: actions/setup-java@v1 with: java-version: 11 - - uses: actions/cache@v2 - with: - path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} - restore-keys: ${{ runner.os }}-gradle - - run: ./gradlew :iceberg-api:revapi + - run: | + echo "Using the old version tag, as per git describe, of $(git describe)"; + - run: ./gradlew :iceberg-api:revapi --rerun-tasks --no-build-cache --no-daemon - uses: actions/upload-artifact@v2 if: failure() with: From d5076def5ad1a1e15b338e657f1e076e813d034e Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Tue, 7 Jun 2022 12:26:15 -0700 Subject: [PATCH 2/5] Remove --no-build-cache and --no-daemon and add a note re: fetch depth of zero --- .github/workflows/api-binary-compatibility.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/api-binary-compatibility.yml b/.github/workflows/api-binary-compatibility.yml index d317a145ddfa..8049b2a0a9bc 100644 --- a/.github/workflows/api-binary-compatibility.yml +++ b/.github/workflows/api-binary-compatibility.yml @@ -40,6 +40,9 @@ jobs: - uses: actions/checkout@v2 if: github.event_name == 'pull_request' with: + # fetch-depth of zero ensures that the tags are pulled in and we're not in a detached HEAD state + # revapi depends on the tags, specifically the tag from git describe, to find the relevant override + # in the .palantir/revapi.yml file fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} - uses: actions/checkout@v2 @@ -51,7 +54,7 @@ jobs: java-version: 11 - run: | echo "Using the old version tag, as per git describe, of $(git describe)"; - - run: ./gradlew :iceberg-api:revapi --rerun-tasks --no-build-cache --no-daemon + - run: ./gradlew :iceberg-api:revapi --rerun-tasks - uses: actions/upload-artifact@v2 if: failure() with: From a1116da9dd5cff08cb4786c2dde4ebbbc126c439 Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Tue, 7 Jun 2022 12:27:21 -0700 Subject: [PATCH 3/5] Add attribution note for the github action issue that resolved this --- .github/workflows/api-binary-compatibility.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/api-binary-compatibility.yml b/.github/workflows/api-binary-compatibility.yml index 8049b2a0a9bc..a2dc69595f82 100644 --- a/.github/workflows/api-binary-compatibility.yml +++ b/.github/workflows/api-binary-compatibility.yml @@ -43,6 +43,8 @@ jobs: # fetch-depth of zero ensures that the tags are pulled in and we're not in a detached HEAD state # revapi depends on the tags, specifically the tag from git describe, to find the relevant override # in the .palantir/revapi.yml file + # + # See https://github.com/actions/checkout/issues/124 fetch-depth: 0 ref: ${{ github.event.pull_request.head.ref }} - uses: actions/checkout@v2 From 897b8db1ee8d2a6fb2038ba906f13cfdfa66d8f3 Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Wed, 8 Jun 2022 11:12:25 -0700 Subject: [PATCH 4/5] Use checkout v3 and remove difference between push and pull --- .github/workflows/api-binary-compatibility.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/api-binary-compatibility.yml b/.github/workflows/api-binary-compatibility.yml index a2dc69595f82..7e9b5bcd8bdf 100644 --- a/.github/workflows/api-binary-compatibility.yml +++ b/.github/workflows/api-binary-compatibility.yml @@ -37,8 +37,7 @@ jobs: revapi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - if: github.event_name == 'pull_request' + - uses: actions/checkout@v3 with: # fetch-depth of zero ensures that the tags are pulled in and we're not in a detached HEAD state # revapi depends on the tags, specifically the tag from git describe, to find the relevant override @@ -46,11 +45,6 @@ jobs: # # See https://github.com/actions/checkout/issues/124 fetch-depth: 0 - ref: ${{ github.event.pull_request.head.ref }} - - uses: actions/checkout@v2 - if: github.event_name == 'push' - with: - fetch-depth: 0 - uses: actions/setup-java@v1 with: java-version: 11 From 809ee7dfab840914c99b2ebe7eddbef0f5258e55 Mon Sep 17 00:00:00 2001 From: Kyle Bendickson Date: Wed, 8 Jun 2022 11:18:05 -0700 Subject: [PATCH 5/5] Run on same ubuntu version as other actions --- .github/workflows/api-binary-compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/api-binary-compatibility.yml b/.github/workflows/api-binary-compatibility.yml index 7e9b5bcd8bdf..40d6459f3c53 100644 --- a/.github/workflows/api-binary-compatibility.yml +++ b/.github/workflows/api-binary-compatibility.yml @@ -35,7 +35,7 @@ concurrency: jobs: revapi: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 with: