Skip to content

Commit 8c73b79

Browse files
committed
chore(ci): run cloud db drivers tests only when credentials are set
1 parent 37a6682 commit 8c73b79

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/drivers-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,13 @@ jobs:
174174
timeout-minutes: 30
175175
needs: [latest-tag-sha, build]
176176
if: (needs['latest-tag-sha'].outputs.sha != github.sha)
177+
env:
178+
CLOUD_DATABASES: athena bigquery databricks-jdbc databricks-jdbc-export-bucket snowflake
179+
# As per docs:
180+
# Secrets cannot be directly referenced in if: conditionals. Instead, consider setting
181+
# secrets as job-level environment variables, then referencing the environment variables
182+
# to conditionally run steps in the job.
183+
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}
177184
strategy:
178185
matrix:
179186
node:
@@ -239,6 +246,10 @@ jobs:
239246
240247
- name: Run tests
241248
uses: nick-fields/retry@v3
249+
# It's enough to test for any one secret because they are set all at once or not set all
250+
if: |
251+
(contains(env.CLOUD_DATABASES, matrix.database) && env.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY != '') ||
252+
(!contains(env.CLOUD_DATABASES, matrix.database))
242253
env:
243254
# Athena
244255
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}

0 commit comments

Comments
 (0)