Skip to content

Commit 3aa1081

Browse files
Disable BigQuery tests if key is not provided
1 parent 83185dc commit 3aa1081

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,30 @@ jobs:
8787
uses: taiki-e/install-action@cargo-llvm-cov
8888

8989
- name: Set up BigQuery environment variables and credentials
90+
if: ${{ secrets.TESTS_BIGQUERY_SA_KEY_JSON != '' && secrets.TESTS_BIGQUERY_PROJECT_ID != '' }}
9091
run: |
9192
printf '%s' '${{ secrets.TESTS_BIGQUERY_SA_KEY_JSON }}' > /tmp/bigquery-sa-key.json
9293
echo "TESTS_BIGQUERY_PROJECT_ID=${{ secrets.TESTS_BIGQUERY_PROJECT_ID }}" >> $GITHUB_ENV
9394
echo "TESTS_BIGQUERY_SA_KEY_PATH=/tmp/bigquery-sa-key.json" >> $GITHUB_ENV
95+
echo "BIGQUERY_TESTS_ENABLED=true" >> $GITHUB_ENV
9496
9597
- name: Generate code coverage
9698
id: coverage
9799
run: |
98-
cargo llvm-cov test \
99-
--workspace --no-fail-fast \
100-
--all-features \
101-
--lcov --output-path lcov.info
100+
if [ "$BIGQUERY_TESTS_ENABLED" = "true" ]; then
101+
echo "Running all tests including BigQuery integration tests"
102+
cargo llvm-cov test \
103+
--workspace --no-fail-fast \
104+
--all-features \
105+
--lcov --output-path lcov.info
106+
else
107+
echo "Running tests excluding BigQuery integration tests (credentials not available)"
108+
cargo llvm-cov test \
109+
--workspace --no-fail-fast \
110+
--all-features \
111+
--lcov --output-path lcov.info \
112+
-- --skip bigquery
113+
fi
102114
103115
- name: Upload coverage to Coveralls
104116
uses: coverallsapp/github-action@v2

0 commit comments

Comments
 (0)