Skip to content

Adding support for snowflake dynamic tables to SqlAlchemy Core #646

Adding support for snowflake dynamic tables to SqlAlchemy Core

Adding support for snowflake dynamic tables to SqlAlchemy Core #646

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main
- prep-**
workflow_dispatch:
inputs:
logLevel:
default: warning
description: "Log level"
required: true
tags:
description: "Test scenario tags"
jobs:
lint:
name: Check linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Upgrade and install tools
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
python -m hatch env create default
- name: Set PY
run: echo "PY=$(hatch run gh-cache-sum)" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run lint checks
run: hatch run check
build-install:
name: Test package build and installation
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: true
matrix:
hatch-env: [default, sa14]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Upgrade and install tools
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
- name: Build package
run: |
python -m hatch -e ${{ matrix.hatch-env }} build --clean
- name: Install and check import
run: |
python -m uv pip install dist/snowflake_sqlalchemy-*.whl
python -c "import snowflake.sqlalchemy; print(snowflake.sqlalchemy.__version__)"
test-dialect:
name: Test dialect ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
needs: [ lint, build-install ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
ubuntu-latest,
macos-13,
windows-latest,
]
python-version: ["3.8"]
cloud-provider: [
aws,
azure,
gcp,
]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and prepare environment
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
python -m hatch env create default
- name: Setup parameters file
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg > tests/parameters.py
- name: Run tests
run: hatch run test-dialect
- uses: actions/upload-artifact@v4
with:
name: coverage.xml_dialect-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
path: |
./coverage.xml
test-dialect-compatibility:
name: Test dialect compatibility ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
needs: [ lint, build-install ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
ubuntu-latest,
macos-13,
windows-latest,
]
python-version: ["3.8"]
cloud-provider: [
aws,
azure,
gcp,
]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and install hatch
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
python -m hatch env create default
- name: Setup parameters file
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg > tests/parameters.py
- name: Run tests
run: hatch run test-dialect-compatibility
- uses: actions/upload-artifact@v4
with:
name: coverage.xml_dialect-compatibility-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
path: |
./coverage.xml
test-dialect-v14:
name: Test dialect v14 ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
needs: [ lint, build-install ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
ubuntu-latest,
macos-13,
windows-latest,
]
python-version: ["3.8"]
cloud-provider: [
aws,
azure,
gcp,
]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup parameters file
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg > tests/parameters.py
- name: Upgrade pip and install hatch
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
python -m hatch env create default
- name: Run tests
run: hatch run sa14:test-dialect
- uses: actions/upload-artifact@v4
with:
name: coverage.xml_dialect-v14-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
path: |
./coverage.xml
test-dialect-compatibility-v14:
name: Test dialect v14 compatibility ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
needs: lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [
ubuntu-latest,
macos-13,
windows-latest,
]
python-version: ["3.8"]
cloud-provider: [
aws,
azure,
gcp,
]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip and install hatch
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
python -m hatch env create default
- name: Setup parameters file
shell: bash
env:
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
run: |
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
.github/workflows/parameters/parameters_${{ matrix.cloud-provider }}.py.gpg > tests/parameters.py
- name: Run tests
run: hatch run sa14:test-dialect-compatibility
- uses: actions/upload-artifact@v4
with:
name: coverage.xml_dialect-v14-compatibility-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
path: |
./coverage.xml
combine-coverage:
name: Combine coverage
if: ${{ success() || failure() }}
needs: [test-dialect, test-dialect-compatibility, test-dialect-v14, test-dialect-compatibility-v14]
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Prepare environment
run: |
python -m pip install -U uv
python -m uv pip install -U hatch
hatch env create default
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Combine coverage files
run: |
hatch run coverage combine -a artifacts/coverage.xml_*/coverage.xml
hatch run coverage report -m
- name: Store coverage reports
uses: actions/upload-artifact@v4
with:
name: coverage.xml
path: coverage.xml
- name: Uplaod to codecov
uses: codecov/codecov-action@v4
with:
file: coverage.xml
env_vars: OS,PYTHON
fail_ci_if_error: false
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
url: https://snowflake.codecov.io/