-
Notifications
You must be signed in to change notification settings - Fork 233
74 lines (70 loc) · 2.82 KB
/
master-pytest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: master-pytest
on:
push:
branches:
- master
pull_request:
types: [opened, reopened]
jobs:
build:
env:
SNOWFLAKE_PASSWORD: ${{ secrets.SCHEMACHANGE_SNOWFLAKE_PASSWORD }}
SNOWFLAKE_USER: ${{ secrets.SCHEMACHANGE_SNOWFLAKE_USER }}
SNOWFLAKE_ACCOUNT: ${{ secrets.SCHEMACHANGE_SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORD: ${{ secrets.SCHEMACHANGE_SNOWFLAKE_PASSWORD }}
SNOWFLAKE_CONNECTIONS_MYCONNECTION_ACCOUNT: ${{ secrets.SCHEMACHANGE_SNOWFLAKE_ACCOUNT }}
SNOWFLAKE_CONNECTIONS_MYCONNECTION_USER: ${{ secrets.SCHEMACHANGE_SNOWFLAKE_USER }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Install dependencies
run: |
python -m pip install -e .[dev]
- name: Test with pytest
run: |
pytest
- name: Setup SnowCLI connection file
run: |
echo "[connections]" > config.toml
echo "[connections.myconnection]" >> config.toml
chmod 0600 config.toml
- name: Install snowcli
run: |
pip install snowflake-cli-labs
- name: Test Default snowcli connection
run: |
snow --version
echo "::group::Config Contents"
more config.toml
echo "::endgroup::"
snow --config-file config.toml connection test -c myconnection
echo "Tested SnowCLI connection successfully!"
echo "Set default connection"
snow --config-file config.toml connection set-default "myconnection"
- name: Test Basic Schemachange
run: |
snow --config-file config.toml sql -f ./demo/setup/setup_basics_demo.sql
schemachange --config-folder ./demo/basics
snow --config-file config.toml sql -f ./demo/teardown/teardown_basics_demo.sql
- name: Test Citibike Demo
run: |
snow --config-file config.toml sql -f ./demo/setup/setup_citibike_demo.sql
schemachange --config-folder ./demo/citibike
snow --config-file config.toml sql -f ./demo/teardown/teardown_citibike_demo.sql
- name: Test Citibike Demo Jinja Template
run: |
snow --config-file config.toml sql -f ./demo/setup/setup_citibike_demo_jinja.sql
schemachange --config-folder ./demo/citibike_jinja
snow --config-file config.toml sql -f ./demo/teardown/teardown_citibike_demo_jinja.sql