Skip to content

Consolidate CI script #2

Consolidate CI script

Consolidate CI script #2

Workflow file for this run

name: Test Extension

Check failure on line 1 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test.yml

Invalid workflow file

(Line: 31, Col: 11): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.BQ_CREDENTIALS_JSON_CI != ''
env:
GITHUB_ACTIONS: true
on:
push:
branches: [ master ]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python environment with uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python and install dependencies
run: |
uv python install 3.11.9
uv venv --python 3.11.9
uv pip install -r requirements.txt
# BigQuery authentication (conditional - only if secrets exist)
- name: Authenticate to Google Cloud
if: ${{ secrets.BQ_CREDENTIALS_JSON_CI != '' }}
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.BQ_CREDENTIALS_JSON_CI }}
project_id: ${{ vars.BQ_TEST_PROJECT }}
create_credentials_file: true
- name: Run tests
run: uv run carto_extension.py test
env:
# CI detection
CI: true
# BigQuery connection settings (conditional)
BQ_TEST_PROJECT: ${{ vars.BQ_TEST_PROJECT }}
BQ_TEST_DATASET: ${{ vars.BQ_TEST_DATASET }}
# Snowflake connection settings (conditional)
SF_USER: ${{ secrets.SF_USER }}
SF_PASSWORD: ${{ secrets.SF_PASSWORD }}
SF_ACCOUNT: ${{ secrets.SF_ACCOUNT }}
SF_TEST_DATABASE: ${{ vars.SF_TEST_DATABASE }}
SF_TEST_SCHEMA: ${{ vars.SF_TEST_SCHEMA }}
# Python path
PYTHONPATH: ${{ github.workspace }}