Skip to content

Commit 75bf091

Browse files
Disable BigQuery tests if key is not provided
1 parent dfe6e40 commit 75bf091

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
@@ -84,18 +84,30 @@ jobs:
8484
uses: taiki-e/install-action@cargo-llvm-cov
8585

8686
- name: Set up BigQuery environment variables and credentials
87+
if: ${{ secrets.TESTS_BIGQUERY_SA_KEY_JSON != '' && secrets.TESTS_BIGQUERY_PROJECT_ID != '' }}
8788
run: |
8889
printf '%s' '${{ secrets.TESTS_BIGQUERY_SA_KEY_JSON }}' > /tmp/bigquery-sa-key.json
8990
echo "TESTS_BIGQUERY_PROJECT_ID=${{ secrets.TESTS_BIGQUERY_PROJECT_ID }}" >> $GITHUB_ENV
9091
echo "TESTS_BIGQUERY_SA_KEY_PATH=/tmp/bigquery-sa-key.json" >> $GITHUB_ENV
92+
echo "BIGQUERY_TESTS_ENABLED=true" >> $GITHUB_ENV
9193
9294
- name: Generate code coverage
9395
id: coverage
9496
run: |
95-
cargo llvm-cov test \
96-
--workspace --no-fail-fast \
97-
--all-features \
98-
--lcov --output-path lcov.info
97+
if [ "$BIGQUERY_TESTS_ENABLED" = "true" ]; then
98+
echo "Running all tests including BigQuery integration tests"
99+
cargo llvm-cov test \
100+
--workspace --no-fail-fast \
101+
--all-features \
102+
--lcov --output-path lcov.info
103+
else
104+
echo "Running tests excluding BigQuery integration tests (credentials not available)"
105+
cargo llvm-cov test \
106+
--workspace --no-fail-fast \
107+
--all-features \
108+
--lcov --output-path lcov.info \
109+
-- --skip bigquery
110+
fi
99111
100112
- name: Upload coverage to Coveralls
101113
uses: coverallsapp/github-action@v2

0 commit comments

Comments
 (0)