Consolidate CI script #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Extension | ||
| 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 }} | ||