This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/flink-connector-jdbc.git

commit 07339ad2bb0b818376ebfa4cde99b425bbc698c5
Author: Chesnay Schepler <ches...@apache.org>
AuthorDate: Mon Feb 6 14:12:20 2023 +0100

    test auto url extraction
---
 .github/workflows/ci.yml      | 26 ++++++++++++++++++++++++--
 .github/workflows/push_pr.yml |  1 -
 2 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c4a589a..b291bd4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -21,7 +21,7 @@ on:
     inputs:
       flink_url:
         description: "Url to Flink binary."
-        required: true
+        required: false
         type: string
       flink_version:
         description: "Flink version to test against."
@@ -29,7 +29,7 @@ on:
         type: string
       cache_flink_binary:
         description: "Whether to cache the Flink binary. Should be false for 
SNAPSHOT URLs, true otherwise."
-        required: true
+        required: false
         type: boolean
       timeout_global:
         description: "The timeout in minutes for the entire workflow."
@@ -73,6 +73,28 @@ jobs:
         with:
           maven-version: 3.8.6
 
+      - name: "Determine Flink binary url"
+        run: |
+          binary_url=""
+          cache_binary=""
+          if [ ${{ inputs.flink_url}} = "" ]; then
+            if [[ ${{ inputs.flink_version }} = *-SNAPSHOT ]]; then
+              binary_url=https://s3.amazonaws.com/flink-nightly/flink-${{ 
inputs.flink_version }}-bin-scala_2.12.tgz
+              cache_binary = false
+            else
+              
binary_url=https://dist.apache.org/repos/dist/release/flink/flink-${{ 
inputs.flink_version }}/flink-${{ inputs.flink_version }}-bin-scala_2.12.tgz
+              cache_binary = true
+            fi
+          else
+            binary_url=${{ inputs.flink_url}}
+            cache_binary=${{ inputs.cache_binary }}
+          fi
+          echo "binary_url=$binary_url" >> $GITHUB_ENV
+          echo "cache_binary=$cache_binary" >> $GITHUB_ENV
+
+      - name: "Print Flink binary url"
+        run: echo "${{ env.binary_url }} / ${{ env.cache_binary }}"
+
       - name: Create cache dirs
         run: mkdir -p ${{ env.FLINK_CACHE_DIR }}
 
diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml
index af2f2f1..03625f9 100644
--- a/.github/workflows/push_pr.yml
+++ b/.github/workflows/push_pr.yml
@@ -26,5 +26,4 @@ jobs:
     uses: ./.github/workflows/ci.yml
     with:
       flink_version: 1.16.1
-      flink_url: 
https://dist.apache.org/repos/dist/release/flink/flink-1.16.1/flink-1.16.1-bin-scala_2.12.tgz
       cache_flink_binary: true

Reply via email to