Skip to content

Commit

Permalink
chore(ci): run cloud db drivers tests only when credentials are set
Browse files Browse the repository at this point in the history
  • Loading branch information
KSDaemon committed Sep 24, 2024
1 parent 37a6682 commit 8c73b79
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ jobs:
timeout-minutes: 30
needs: [latest-tag-sha, build]
if: (needs['latest-tag-sha'].outputs.sha != github.sha)
env:
CLOUD_DATABASES: athena bigquery databricks-jdbc databricks-jdbc-export-bucket snowflake
# As per docs:
# Secrets cannot be directly referenced in if: conditionals. Instead, consider setting
# secrets as job-level environment variables, then referencing the environment variables
# to conditionally run steps in the job.
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}
strategy:
matrix:
node:
Expand Down Expand Up @@ -239,6 +246,10 @@ jobs:
- name: Run tests
uses: nick-fields/retry@v3
# It's enough to test for any one secret because they are set all at once or not set all
if: |
(contains(env.CLOUD_DATABASES, matrix.database) && env.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY != '') ||
(!contains(env.CLOUD_DATABASES, matrix.database))
env:
# Athena
DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY: ${{ secrets.DRIVERS_TESTS_ATHENA_CUBEJS_AWS_KEY }}
Expand Down

0 comments on commit 8c73b79

Please sign in to comment.