Snowflake Dialect and Testing #20
Workflow file for this run
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: Run SF Tests | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| get-msg: | |
| name: Get Commit Message | |
| runs-on: ubuntu-latest | |
| outputs: | |
| commitMsg: ${{ steps.get_msg.outputs.commitMsg }} | |
| steps: | |
| # Fetch the branch for the history only | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| sparse-checkout: . | |
| - name: Get Commit Message | |
| id: get_msg | |
| run: | | |
| set -xe pipefail | |
| echo "commitMsg=$(git log -1 --pretty=format:'%s')" >> $GITHUB_OUTPUT | |
| sf-tests: | |
| name: Snowflake Tests (Python ${{ matrix.python-version }}) | |
| needs: [get-msg] | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| contains(needs.get-msg.outputs.commitMsg, '[run sf]') | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| env: | |
| SF_USERNAME: ${{ secrets.SF_USERNAME }} | |
| SF_PASSWORD: ${{ secrets.SF_PASSWORD }} | |
| SF_ACCOUNT: ${{ secrets.SF_ACCOUNT }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| with: | |
| version: "0.4.23" | |
| - name: Create virtual environment and install dependencies | |
| run: | | |
| uv venv .venv | |
| . .venv/bin/activate | |
| # Install editable mode with Snowflake extras for CI tests | |
| uv pip install -e ".[snowflake]" | |
| - name: Run Snowflake Tests | |
| run: | | |
| . .venv/bin/activate | |
| uv run --python ${{ matrix.python-version }} pytest -m snowflake tests/ -rs |