Skip to content

Commit 1828380

Browse files
authored
chore(ci): run cloud db drivers tests only when credentials are set (#8736)
* chore(ci): run cloud db drivers tests only when credentials are set * remove config-inline in publish/docker-push as actionlint is complaining and this option is already not supported for some time
1 parent cb9bb70 commit 1828380

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
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 }}

.github/workflows/publish.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,6 @@ jobs:
381381
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
382382
org.opencontainers.image.revision=${{ github.sha }}
383383
org.opencontainers.image.licenses=${{ fromJson(steps.repo.outputs.result).license.spdx_id }}
384-
# Workaround for yarn v1, it uses aggressive timeouts with summing time spending on fs, https://github.com/yarnpkg/yarn/issues/4890
385-
config-inline: |
386-
[worker.oci]
387-
max-parallelism = 1
388384
build-args: |
389385
IMAGE_VERSION=${{ steps.prep.outputs.version }}
390386

0 commit comments

Comments
 (0)